Commit 249aca8f authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/movtextdec: Check style_start/end

Limits based on 3GPP TS 26.245 V14.0.0
Fixes: Timeout
Fixes: 6377/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MOVTEXT_fuzzer-5175929115508736

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegReviewed-by: 's avatarPhilip Langdale <philipl@overt.org>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent c837918f
...@@ -299,6 +299,14 @@ static int decode_styl(const uint8_t *tsmb, MovTextContext *m, AVPacket *avpkt) ...@@ -299,6 +299,14 @@ static int decode_styl(const uint8_t *tsmb, MovTextContext *m, AVPacket *avpkt)
m->s_temp->style_start = AV_RB16(tsmb); m->s_temp->style_start = AV_RB16(tsmb);
tsmb += 2; tsmb += 2;
m->s_temp->style_end = AV_RB16(tsmb); m->s_temp->style_end = AV_RB16(tsmb);
if ( m->s_temp->style_end < m->s_temp->style_start
|| (m->count_s && m->s_temp->style_start < m->s[m->count_s - 1]->style_end)) {
av_freep(&m->s_temp);
mov_text_cleanup(m);
return AVERROR(ENOMEM);
}
tsmb += 2; tsmb += 2;
m->s_temp->style_fontID = AV_RB16(tsmb); m->s_temp->style_fontID = AV_RB16(tsmb);
tsmb += 2; tsmb += 2;
......
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