1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

lavc: check return values consistency when decoding subtitles.

This commit is contained in:
Nicolas George 2013-02-13 10:40:41 +01:00
parent e568d432b1
commit ccc7bcc4fc

View File

@ -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);