[FFmpeg-devel] [PATCH] huffyuvdec: validate image size

Andreas Cadhalpun andreas.cadhalpun at googlemail.com
Sun Jun 28 11:23:12 CEST 2015


On 27.06.2015 22:40, Michael Niedermayer wrote:
> On Sat, Jun 27, 2015 at 07:42:48PM +0200, Andreas Cadhalpun wrote:
>> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
>> ---
>>  libavcodec/huffyuvdec.c | 6 ++++++
>>  1 file changed, 6 insertions(+)
>>
>> diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c
>> index 98c6128..71fb9e3 100644
>> --- a/libavcodec/huffyuvdec.c
>> +++ b/libavcodec/huffyuvdec.c
>> @@ -291,6 +291,12 @@ static av_cold int decode_init(AVCodecContext *avctx)
>>      HYuvContext *s = avctx->priv_data;
>>      int ret;
>>  
>> +    if (avctx->width <= 0 || avctx->height <= 0) {
> 
> LGTM
> alternatively av_image_check_size() could be used but this should
> be equally fine

On 27.06.2015 22:40, Luca Barbato wrote:
> There is a function to validate the dimensions. That isn't enough, I
> think I sent a patch recently that does that for another codec.

OK, new patch using av_image_check_size attached.

Best regards,
Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-huffyuvdec-validate-image-size.patch
Type: text/x-diff
Size: 1040 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150628/10e72dac/attachment.bin>


More information about the ffmpeg-devel mailing list