Commit 7d66bc79 authored by Clément Bœsch's avatar Clément Bœsch

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

Fixes Ticket #2087.
parent 1dd4a21c
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment