On Thu, Mar 30, 2017 at 8:07 PM, Luca Barbato <[email protected]> wrote:
> On 30/03/2017 22:21, Sean McGovern wrote:
>> CC: [email protected]
>> Bug-Id: 1012
>> ---
>> This patch stops the crash from Bugzilla #1012, however, the real issue is:
>> mpeg4videodec.c:decode_init() needs to be called somewhere before the call to
>> av_parser_parse2() in libavformat/utils.c:parse_packet()
>> ---
>>  libavcodec/mpeg4videodec.c |    4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
>> index 8891ec1..2be68ee 100644
>> --- a/libavcodec/mpeg4videodec.c
>> +++ b/libavcodec/mpeg4videodec.c
>> @@ -186,6 +186,10 @@ static int 
>> mpeg4_decode_sprite_trajectory(Mpeg4DecContext *ctx, GetBitContext *g
>>      if (w <= 0 || h <= 0)
>>          return AVERROR_INVALIDDATA;
>>
>> +    /* the decoder was not properly intialized and we cannot continue */
> typo above (initialize)

Ooops, yeah -- will fix.

>
>> +    if (sprite_trajectory.table == NULL)
>> +        return AVERROR_INVALIDDATA;
>
> It is in line with the checks about w <= 0 so I'm not totally against
> it, who is supposed to set that table though?

As per my comment up top, it looks like it is set up in
mpeg4videodec.c:decode_init(), but
that function is static.

Even though it is the root cause, it is external to the crash this
patch attempts to remedy.

Should it the decoder be probed for somehow ? And if so, where?

How should it react if libav is built with only the parser and not the decoder?

Can I go ahead and push this tomorrow anyways after I fix the spelling mistake?

>
>> +
>>      for (i = 0; i < ctx->num_sprite_warping_points; i++) {
>>          int length;
>>          int x = 0, y = 0;
>>
>
> _______________________________________________
> libav-devel mailing list
> [email protected]
> https://lists.libav.org/mailman/listinfo/libav-devel
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to