[FFmpeg-cvslog] Avoid img_segment_size == 0 in mtv demuxer.

Carl Eugen Hoyos git at videolan.org
Mon Sep 30 11:28:34 CEST 2013


ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Sun Sep 29 20:09:56 2013 +0200| [e34ba4723ee5461dc29f8973f5cbe6e31575ab81] | committer: Carl Eugen Hoyos

Avoid img_segment_size == 0 in mtv demuxer.

Fixes ticket #3011.

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

 libavformat/mtv.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/mtv.c b/libavformat/mtv.c
index 29c26c6..0517dd2 100644
--- a/libavformat/mtv.c
+++ b/libavformat/mtv.c
@@ -105,8 +105,8 @@ static int mtv_read_header(AVFormatContext *s)
         mtv->img_height=mtv->img_segment_size / (mtv->img_bpp>>3)
                         / mtv->img_width;
     }
-    if(!mtv->img_height || !mtv->img_width){
-        av_log(s, AV_LOG_ERROR, "width or height is invalid and I cannot calculate them from other information\n");
+    if(!mtv->img_height || !mtv->img_width || !mtv->img_segment_size){
+        av_log(s, AV_LOG_ERROR, "width or height or segment_size is invalid and I cannot calculate them from other information\n");
         return AVERROR(EINVAL);
     }
 



More information about the ffmpeg-cvslog mailing list