[FFmpeg-cvslog] lavc: check return values consistency when decoding subtitles.

Nicolas George git at videolan.org
Sun Feb 24 12:20:40 CET 2013


ffmpeg | branch: master | Nicolas George <nicolas.george at normalesup.org> | Wed Feb 13 10:40:41 2013 +0100| [ccc7bcc4fcaab51abfc618a8d74fb1e7f07005f1] | committer: Nicolas George

lavc: check return values consistency when decoding subtitles.

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

 libavcodec/utils.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 313b45a..bc3f172 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1976,6 +1976,8 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
                 sub->pts = av_rescale_q(avpkt->pts,
                                         avctx->pkt_timebase, AV_TIME_BASE_Q);
             ret = avctx->codec->decode(avctx, sub, got_sub_ptr, &pkt_recoded);
+            av_assert1((ret >= 0) >= !!*got_sub_ptr &&
+                       !!*got_sub_ptr >= !!sub->num_rects);
             if (tmp.data != pkt_recoded.data)
                 av_free(pkt_recoded.data);
             sub->format = !(avctx->codec_descriptor->props & AV_CODEC_PROP_BITMAP_SUB);



More information about the ffmpeg-cvslog mailing list