[FFmpeg-devel] [PATCH 4/7] Ensure that the video dimension are a multiple of 16 in the 4xm decoder.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Oct 2 12:34:22 CEST 2011



On 2 Oct 2011, at 03:03, Michael Niedermayer <michaelni at gmx.at> wrote:

> On Sun, Oct 02, 2011 at 12:38:29AM +0200, fenrir at elivagar.org wrote:
>> From: Laurent Aimar <fenrir at videolan.org>
>> 
>> ---
>> libavcodec/4xm.c |    2 ++
>> 1 files changed, 2 insertions(+), 0 deletions(-)
>> 
>> diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c
>> index 6335879..6ee9b34 100644
>> --- a/libavcodec/4xm.c
>> +++ b/libavcodec/4xm.c
>> @@ -866,6 +866,8 @@ static av_cold int decode_init(AVCodecContext *avctx){
>>         return 1;
>>     }
>> 
>> +    avctx->width  = FFALIGN(avctx->width, 16);
>> +    avctx->height = FFALIGN(avctx->height, 16);
>>     avcodec_get_frame_defaults(&f->current_picture);
> 
> This doesnt look correct.
> If width/height must be a multiple of 16 then the decoder should fail
> if its not so. Otherwise it should support it and not return a bigger
> picture
> also see avcodec_align_dimensions2()

In addition width and height should never be set directly but instead using the appropriate function that also sets coded_width and does some checks (I think something with set_dimensions it is called).
> 


More information about the ffmpeg-devel mailing list