[FFmpeg-cvslog] fraps: check for overread

Michael Niedermayer git at videolan.org
Wed Nov 9 00:18:45 CET 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Nov  8 22:42:50 2011 +0100| [3bdfef31ac135add243f9ddde99d6b3cee953833] | committer: Michael Niedermayer

fraps: check for overread
Fixeds Ticket619

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

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

 libavcodec/fraps.c      |    2 ++
 tests/ref/fate/fraps-v5 |    1 -
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/libavcodec/fraps.c b/libavcodec/fraps.c
index d6f9a55..0844fa7 100644
--- a/libavcodec/fraps.c
+++ b/libavcodec/fraps.c
@@ -114,6 +114,8 @@ static int fraps2_decode_plane(FrapsContext *s, uint8_t *dst, int stride, int w,
             else if(Uoff) dst[i] += 0x80;
         }
         dst += stride;
+        if(get_bits_left(&gb) < 0)
+            return -1;
     }
     free_vlc(&vlc);
     return 0;
diff --git a/tests/ref/fate/fraps-v5 b/tests/ref/fate/fraps-v5
index 05fa9da..3fe1c49 100644
--- a/tests/ref/fate/fraps-v5
+++ b/tests/ref/fate/fraps-v5
@@ -56,4 +56,3 @@
 0, 165000, 145152, 0x80448031
 0, 168000, 145152, 0xe3b1fbf7
 0, 171000, 145152, 0xa00395a4
-0, 174000, 145152, 0xdf3b4fce



More information about the ffmpeg-cvslog mailing list