History

avcodec/h264_parser: Fix nalsize check

Fixes: Assertion failure Fixes: 37463/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-4914693494931456

Michael Niedermayer committed 5 years ago

Commit 2d36d2f1 parent 38ab20e1 file · +2 −2Browse files

Unified · Split

libavcodec/h264_parser.c+2−2
@@ -83,12 +83,12 @@ static int h264_find_frame_end(H264ParseContext *p, const uint8_t *buf, · 82 unmodified lines
8383
8484 for (i = 0; i < buf_size; i++) {
8585 if (i >= next_avc) {
86− uint32_t nalsize = 0;
86+ int64_t nalsize = 0;
8787 i = next_avc;
8888 for (j = 0; j < p->nal_length_size; j++)
8989 nalsize = (nalsize << 8) | buf[i++];
9090 if (!nalsize || nalsize > buf_size - i) {
91− av_log(logctx, AV_LOG_ERROR, "AVC-parser: nal size %"PRIu32" "
91+ av_log(logctx, AV_LOG_ERROR, "AVC-parser: nal size %"PRId64" "
9292 "remaining %d\n", nalsize, buf_size - i);
9393 return buf_size;
9494 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t