[FFmpeg-devel] [PATCH] vp9: don't retain NULL as segmentation_map

Andreas Cadhalpun andreas.cadhalpun at googlemail.com
Wed Jun 17 20:56:51 CEST 2015


Hi Ronald,

On 17.06.2015 20:26, Ronald S. Bultje wrote:
> On Jun 17, 2015 10:07 AM, "Andreas Cadhalpun" <
> andreas.cadhalpun at googlemail.com> wrote:
>>
>> This fixes segmentation faults, which were introduced in commit
>> 4ba8f327.
>>
>> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
>> ---
>>  libavcodec/vp9.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
>> index 4e2ed53..9d9326c 100644
>> --- a/libavcodec/vp9.c
>> +++ b/libavcodec/vp9.c
>> @@ -3988,7 +3988,8 @@ static int vp9_decode_frame(AVCodecContext *ctx,
> void *frame,
>>      int size = pkt->size;
>>      VP9Context *s = ctx->priv_data;
>>      int res, tile_row, tile_col, i, ref, row, col;
>> -    int retain_segmap_ref = s->segmentation.enabled &&
> !s->segmentation.update_map;
>> +    int retain_segmap_ref = s->segmentation.enabled &&
> !s->segmentation.update_map
>> +                            &&
> s->frames[REF_FRAME_SEGMAP].segmentation_map;
>>      ptrdiff_t yoff, uvoff, ls_y, ls_uv;
>>      AVFrame *f;
>>      int bytesperpixel;
>> --
>> 2.1.4
> 
> I might take a few days to respond, I'd like to look at this with some more
> detailed focus, but feel free to apply before that since it seems to fix a
> crash.

OK, I'd wait till tomorrow before applying to give others some time to comment
on it.
I could send you a sample if that'd help you analyzing this in detail.

Best regards,
Andreas



More information about the ffmpeg-devel mailing list