Hi,

On Wed, Feb 15, 2012 at 9:30 PM, Kostya Shishkov
<[email protected]> wrote:
> On Wed, Feb 15, 2012 at 04:21:45PM -0800, Ronald S. Bultje wrote:
>> From: "Ronald S. Bultje" <[email protected]>
>>
>> The codec would keep returning the last decoded frame if the stream
>> contains B-frames, since it wouldn't clear that frame from the list of
>> frames to be returned to the user.
>> ---
>>  libavcodec/cavsdec.c |    1 +
>>  1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c
>> index 2f4b6e3..94c1e4b 100644
>> --- a/libavcodec/cavsdec.c
>> +++ b/libavcodec/cavsdec.c
>> @@ -656,6 +656,7 @@ static int cavs_decode_frame(AVCodecContext * avctx,void 
>> *data, int *data_size,
>>          if (!s->low_delay && h->DPB[0].f.data[0]) {
>>              *data_size = sizeof(AVPicture);
>>              *picture = *(AVFrame *) &h->DPB[0];
>> +            memset(&h->DPB[0], 0, sizeof(h->DPB[0]));
>>          }
>>          return 0;
>>      }
>> --
>
> Won't this cause picture leaks?

No, actual picture freeing/allocating/management happens in the parent
class (mpegenccontext). This is just a copy.

Ronald
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to