[FFmpeg-cvslog] mtvdemuxer: fix segfault caused by truncated packets.

Michael Niedermayer git at videolan.org
Fri Dec 16 17:18:18 CET 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Dec 16 16:23:47 2011 +0100| [f890cb948c932e3b01f9a616ff1600769c539853] | committer: Michael Niedermayer

mtvdemuxer: fix segfault caused by truncated packets.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

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

diff --git a/libavformat/mtv.c b/libavformat/mtv.c
index b31e4cb..4252309 100644
--- a/libavformat/mtv.c
+++ b/libavformat/mtv.c
@@ -196,7 +196,7 @@ static int mtv_read_packet(AVFormatContext *s, AVPacket *pkt)
          * just swap bytes as they come
          */
 
-        for(i=0;i<mtv->img_segment_size/2;i++)
+        for(i=0;i<ret/2;i++)
             *((uint16_t *)pkt->data+i) = av_bswap16(*((uint16_t *)pkt->data+i));
 #endif
         pkt->stream_index = 0;



More information about the ffmpeg-cvslog mailing list