libstagefright: avoid memory leak
authorMohamed Naufal <naufal22@gmail.com>
Wed, 18 Apr 2012 21:30:41 +0000 (03:00 +0530)
committerMohamed Naufal <naufal22@gmail.com>
Wed, 18 Apr 2012 21:30:41 +0000 (03:00 +0530)
libavcodec/libstagefright.cpp

index ef45fae..a74c5a3 100644 (file)
@@ -400,6 +400,8 @@ static int Stagefright_decode_frame(AVCodecContext *avctx, void *data,
                 frame->size = orig_size;
             }
             memcpy(frame->buffer, ptr, orig_size);
+            if (avpkt == &pkt)
+                av_free(avpkt->data);
 
             frame->time = ++s->frame_index;
             (*s->ts_map)[s->frame_index].pts = avpkt->pts;