h264: check for out of bounds reads in ff_h264_decode_extradata().
Signed-off-by: Anton Khirnov <anton@khirnov.net>
This commit is contained in:
parent
a246cefa75
commit
d1186ff72d
1 changed files with 4 additions and 0 deletions
|
|
@ -1005,6 +1005,8 @@ int ff_h264_decode_extradata(H264Context *h)
|
|||
p += 6;
|
||||
for (i = 0; i < cnt; i++) {
|
||||
nalsize = AV_RB16(p) + 2;
|
||||
if (p - avctx->extradata + nalsize > avctx->extradata_size)
|
||||
return -1;
|
||||
if(decode_nal_units(h, p, nalsize) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Decoding sps %d from avcC failed\n", i);
|
||||
return -1;
|
||||
|
|
@ -1015,6 +1017,8 @@ int ff_h264_decode_extradata(H264Context *h)
|
|||
cnt = *(p++); // Number of pps
|
||||
for (i = 0; i < cnt; i++) {
|
||||
nalsize = AV_RB16(p) + 2;
|
||||
if (p - avctx->extradata + nalsize > avctx->extradata_size)
|
||||
return -1;
|
||||
if (decode_nal_units(h, p, nalsize) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Decoding pps %d from avcC failed\n", i);
|
||||
return -1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue