[FFmpeg-cvslog] lavc/movtextdec: keep the min size instead of max to fix overread.

Clément Bœsch git at videolan.org
Tue Jan 1 16:43:20 CET 2013


ffmpeg | branch: master | Clément Bœsch <ubitux at gmail.com> | Tue Jan  1 16:41:37 2013 +0100| [7d66bc7920240cc0e8df6c44b2d2cdbe4b228fbe] | committer: Clément Bœsch

lavc/movtextdec: keep the min size instead of max to fix overread.

Fixes Ticket #2087.

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

 libavcodec/movtextdec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/movtextdec.c b/libavcodec/movtextdec.c
index a65bbb8..05ff53a 100644
--- a/libavcodec/movtextdec.c
+++ b/libavcodec/movtextdec.c
@@ -83,7 +83,7 @@ static int mov_text_decode_frame(AVCodecContext *avctx,
      * In complex cases, there are style descriptors appended to the string
      * so we can't just assume the packet size is the string size.
      */
-    end = ptr + FFMAX(2 + AV_RB16(ptr), avpkt->size);
+    end = ptr + FFMIN(2 + AV_RB16(ptr), avpkt->size);
     ptr += 2;
 
     ts_start = av_rescale_q(avpkt->pts,



More information about the ffmpeg-cvslog mailing list