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

Nicolas George nicolas.george at normalesup.org
Sun Feb 24 12:21:04 CET 2013


Le quintidi 25 pluviôse, an CCXXI, Nicolas George a écrit :
> 
> 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;

Rebased and pushed.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130224/44be5216/attachment.asc>


More information about the ffmpeg-devel mailing list