[FFmpeg-cvslog] mvdec: Check the frame counter against the correct limit.

Michael Niedermayer git at videolan.org
Sun Jan 27 02:51:49 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Jan 27 02:08:22 2013 +0100| [362271d72fc38cd1f4b076aff9a12b1104c26760] | committer: Michael Niedermayer

mvdec: Check the frame counter against the correct limit.

fixes out of array reads

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavformat/mvdec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/mvdec.c b/libavformat/mvdec.c
index c58567c..03471f1 100644
--- a/libavformat/mvdec.c
+++ b/libavformat/mvdec.c
@@ -372,7 +372,7 @@ static int mv_read_packet(AVFormatContext *avctx, AVPacket *pkt)
     int ret;
     uint64_t pos;
 
-    if (frame  < st->nb_frames) {
+    if (frame  < st->nb_index_entries) {
         index = &st->index_entries[frame];
         pos = avio_tell(pb);
         if (index->pos > pos)



More information about the ffmpeg-cvslog mailing list