author | Yvonne Chen <yvonne.chen@amlogic.com> | 2017-07-20 05:16:56 (GMT) |
---|---|---|
committer | Yvonne Chen <yvonne.chen@amlogic.com> | 2017-07-20 05:16:59 (GMT) |
commit | a993f1b4f2a51a244eba324bedec3ff4f9e000da (patch) | |
tree | 34fa319f9469b8de1154463aef4a826a8267141b | |
parent | 5ffd53299b6757239059db0c676a274ad37d164a (diff) | |
download | ffmpeg-a993f1b4f2a51a244eba324bedec3ff4f9e000da.zip ffmpeg-a993f1b4f2a51a244eba324bedec3ff4f9e000da.tar.gz ffmpeg-a993f1b4f2a51a244eba324bedec3ff4f9e000da.tar.bz2 |
fix 264 mp4 file probe carsh
PD#147475
Change-Id: I9663866a85a1051a34150e5bc8485fc8e8c4c8b9
-rw-r--r-- | libavcodec/h264_parse.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/h264_parse.c b/libavcodec/h264_parse.c index ea202e7..e21582b 100644 --- a/libavcodec/h264_parse.c +++ b/libavcodec/h264_parse.c @@ -455,6 +455,9 @@ int ff_h264_decode_extradata(const uint8_t *data, int size, H264ParamSets *ps, nalsize = AV_RB16(p) + 2; if (nalsize > size - (p - data)) return AVERROR_INVALIDDATA; + if (nalsize < 0) + return AVERROR_INVALIDDATA; + ret = decode_extradata_ps_mp4(p, nalsize, ps, err_recognition, logctx); if (ret < 0) { av_log(logctx, AV_LOG_ERROR, @@ -469,6 +472,8 @@ int ff_h264_decode_extradata(const uint8_t *data, int size, H264ParamSets *ps, nalsize = AV_RB16(p) + 2; if (nalsize > size - (p - data)) return AVERROR_INVALIDDATA; + if (nalsize < 0) + return AVERROR_INVALIDDATA; ret = decode_extradata_ps_mp4(p, nalsize, ps, err_recognition, logctx); if (ret < 0) { av_log(logctx, AV_LOG_ERROR, |