summaryrefslogtreecommitdiff
path: root/libavcodec/utils.c
diff options
context:
space:
mode:
authorNicolas George <nicolas.george@normalesup.org>2013-02-13 10:40:41 +0100
committerNicolas George <nicolas.george@normalesup.org>2013-02-24 12:18:57 +0100
commitccc7bcc4fcaab51abfc618a8d74fb1e7f07005f1 (patch)
treec5af540d5f6339cf07abc7bf13e147a249d14104 /libavcodec/utils.c
parente568d432b1d89b9d24025cf13df7505edff1f11f (diff)
lavc: check return values consistency when decoding subtitles.
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 313b45ad97..bc3f172eff 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);