Codebase list faad2 / f1f8e00
add patch to prevent crash on SCE followed by CPE hDecoder->element_alloced denotes whether or not we have allocated memory for usage in terms of the specified channel element. Given that it previously only had two states (1 meaning allocated, and 0 meaning not allocated), it would not allocate enough memory for parsing a CPE it if is preceeded by a SCE (and therefor crash). These changes fixes the issue by making sure that we allocate additional memory if so is necessary, and the set of values for hDecoder->element_alloced[n] is now: 0 = nothing allocated 1 = allocated enough for SCE 2 = allocated enough for CPE All branches that depend on hDecoder->element_alloced[n] prior to this patch only checks if the value is, or is not, zero. The added state, 2, is therefor correctly handled automatically. https://github.com/videolan/vlc/blob/master/contrib/src/faad2/faad2-fix-cpe-reconstruction.patch Fabian Greffrath 4 years ago
1 changed file(s) with 2 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
11081108 #ifdef PROFILE
11091109 int64_t count = faad_get_ts();
11101110 #endif
1111 if (hDecoder->element_alloced[hDecoder->fr_ch_ele] == 0)
1111 if (hDecoder->element_alloced[hDecoder->fr_ch_ele] != 2)
11121112 {
11131113 retval = allocate_channel_pair(hDecoder, cpe->channel, (uint8_t)cpe->paired_channel);
11141114 if (retval > 0)
11151115 return retval;
11161116
1117 hDecoder->element_alloced[hDecoder->fr_ch_ele] = 1;
1117 hDecoder->element_alloced[hDecoder->fr_ch_ele] = 2;
11181118 }
11191119
11201120 /* dequantisation and scaling */