[FFmpeg-cvslog] mmaldec: do not mutate user's AVCodecContext extradata field

wm4 git at videolan.org
Tue Aug 11 12:14:21 CEST 2015


ffmpeg | branch: master | wm4 <nfxjfg at googlemail.com> | Tue Aug 11 11:30:25 2015 +0200| [7f116973d59bbadce891320e338f5786ce31c65a] | committer: wm4

mmaldec: do not mutate user's AVCodecContext extradata field

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7f116973d59bbadce891320e338f5786ce31c65a
---

 libavcodec/mmaldec.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/libavcodec/mmaldec.c b/libavcodec/mmaldec.c
index c775f50..e2c2e57 100644
--- a/libavcodec/mmaldec.c
+++ b/libavcodec/mmaldec.c
@@ -361,10 +361,8 @@ static av_cold int ffmmal_init_decoder(AVCodecContext *avctx)
             ret = AVERROR(ENOSYS);
             goto fail;
         }
-        av_bitstream_filter_filter(ctx->bsfc, avctx, NULL, &dummy_p, &dummy_int, NULL, 0, 0);
-    }
-
-    if (avctx->extradata_size) {
+        av_bitstream_filter_filter(ctx->bsfc, avctx, "private_spspps_buf", &dummy_p, &dummy_int, NULL, 0, 0);
+    } else if (avctx->extradata_size) {
         if ((status = mmal_format_extradata_alloc(format_in, avctx->extradata_size)))
             goto fail;
         format_in->extradata_size = avctx->extradata_size;
@@ -453,7 +451,7 @@ static int ffmmal_add_packet(AVCodecContext *avctx, AVPacket *avpkt)
         if (ctx->bsfc) {
             uint8_t *tmp_data;
             int tmp_size;
-            if ((ret = av_bitstream_filter_filter(ctx->bsfc, avctx, NULL,
+            if ((ret = av_bitstream_filter_filter(ctx->bsfc, avctx, "private_spspps_buf",
                                                   &tmp_data, &tmp_size,
                                                   avpkt->data, avpkt->size,
                                                   avpkt->flags & AV_PKT_FLAG_KEY)) < 0)



More information about the ffmpeg-cvslog mailing list