Any comments are appreciated. Can this patch be considered acceptable solution to make application survive on broken video streams? See issues http://trac.videolan.org/vlc/ticket/5620 https://bugzilla.libav.org/show_bug.cgi?id=108
-- Andrey Utkin
From ee3099f4309beb3c819945b63f5e1b69359a8920 Mon Sep 17 00:00:00 2001 From: Andrey Utkin <[email protected]> Date: Wed, 7 Dec 2011 17:44:50 +0200 Subject: [PATCH] Avoid abort() on decoding mpeg video, just raise the error --- libavcodec/mpegvideo.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index 9c55af7..d4d1189 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -1104,7 +1104,6 @@ int ff_find_unused_picture(MpegEncContext *s, int shared) * all. Similarly, missing reference frames have to be replaced by * interpolated/MC frames, anything else is a bug in the codec ... */ - abort(); return -1; } @@ -1163,6 +1162,10 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx) pic= s->current_picture_ptr; //we already have a unused image (maybe it was set before reading the header) else{ i= ff_find_unused_picture(s, 0); + if (i == -1) { + av_log(avctx, AV_LOG_ERROR, "ff_find_unused_picture returned -1, raising error\n"); + return -1; + } pic= &s->picture[i]; } -- 1.7.7
_______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
