[FFmpeg-devel] [PATCH] Check malloc values in swscale.

Ramiro Polla ramiro.polla
Wed Aug 26 22:43:45 CEST 2009


On Sun, Aug 23, 2009 at 7:05 PM, Michael Niedermayer<michaelni at gmx.at> wrote:
> On Sun, Aug 23, 2009 at 06:50:09PM -0300, Ramiro Polla wrote:
[...]
>> @@ -1737,7 +1738,7 @@
>>
>> ? ? ?// Note the +1 is for the MMX scaler which reads over the end
>> ? ? ?/* align at 16 for AltiVec (needed by hScale_altivec_real) */
>> - ? ?*outFilter= av_mallocz(*outFilterSize*(dstW+1)*sizeof(int16_t));
>> + ? ?CHECKED_ALLOCZ(*outFilter, *outFilterSize*(dstW+1)*sizeof(int16_t));
>>
>> ? ? ?/* normalize & store in outFilter */
>> ? ? ?for (i=0; i<dstW; i++) {
>> @@ -1764,7 +1765,7 @@
>> ? ? ?}
>>
>> ? ? ?ret=0;
>> -error:
>> +fail:
>> ? ? ?av_free(filter);
>> ? ? ?av_free(filter2);
>> ? ? ?return ret;
>
> i doubt, this with the lack of checks of the return value wil work

Do you mean that the return value of initFilter() is not checked?
Patch attached.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: initFilter_check_return.diff
Type: text/x-diff
Size: 2369 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090826/5b69a9e2/attachment.diff>



More information about the ffmpeg-devel mailing list