[FFmpeg-devel] [PATCH 2/2] lavc: check return values consistency when decoding subtitles.

Nicolas George nicolas.george at normalesup.org
Wed Feb 13 10:56:18 CET 2013


Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
---
 libavcodec/utils.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 0844b24..be26f5c 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1844,6 +1844,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, &tmp);
+        av_assert1((ret >= 0) >= !!*got_sub_ptr &&
+                   !!*got_sub_ptr >= !!sub->num_rects);
         sub->format = sub->num_rects && sub->rects[0]->ass;
 
         avctx->pkt = NULL;
-- 
1.7.10.4



More information about the ffmpeg-devel mailing list