[FFmpeg-cvslog] cdgraphics: do not return 0 from the decode function

Anton Khirnov git at videolan.org
Tue Aug 12 18:55:55 CEST 2014


ffmpeg | branch: release/0.10 | Anton Khirnov <anton at khirnov.net> | Wed Aug  6 10:56:34 2014 +0000| [cf6b2a0ad2b06aabf04bec4c7b19e78a560cd904] | committer: Anton Khirnov

cdgraphics: do not return 0 from the decode function

0 means no data consumed, so it can trigger an infinite loop in the
caller.

CC:libav-stable at libav.org
(cherry picked from commit c7d9b473e28238d4a4ef1b7e8b42c1cca256da36)
Signed-off-by: Anton Khirnov <anton at khirnov.net>

Conflicts:
	libavcodec/cdgraphics.c

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cf6b2a0ad2b06aabf04bec4c7b19e78a560cd904
---

 libavcodec/cdgraphics.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavcodec/cdgraphics.c b/libavcodec/cdgraphics.c
index dc2aa07..9ab00b4 100644
--- a/libavcodec/cdgraphics.c
+++ b/libavcodec/cdgraphics.c
@@ -348,11 +348,10 @@ static int cdg_decode_frame(AVCodecContext *avctx,
         *data_size = sizeof(AVFrame);
     } else {
         *data_size = 0;
-        buf_size   = 0;
     }
 
     *(AVFrame *) data = cc->frame;
-    return buf_size;
+    return avpkt->size;
 }
 
 static av_cold int cdg_decode_end(AVCodecContext *avctx)



More information about the ffmpeg-cvslog mailing list