[FFmpeg-cvslog] avcodec/flacdec: Return error code instead of 0 for failures
Michael Niedermayer
git at videolan.org
Sun May 14 19:45:07 EEST 2017
ffmpeg | branch: release/3.3 | Michael Niedermayer <michael at niedermayer.cc> | Tue May 9 13:25:34 2017 +0200| [224b47f76dbe360a394ef85b9a3beaf11bb39c5f] | committer: Michael Niedermayer
avcodec/flacdec: Return error code instead of 0 for failures
Fixes: infinite loop
Fixes: 1418/clusterfuzz-testcase-minimized-5934472438480896
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 3f5a68533decdfb4757207e8d7b5af06e1dcd197)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=224b47f76dbe360a394ef85b9a3beaf11bb39c5f
---
libavcodec/flacdec.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c
index f73a32b461..581c73efc8 100644
--- a/libavcodec/flacdec.c
+++ b/libavcodec/flacdec.c
@@ -205,12 +205,12 @@ static int get_metadata_size(const uint8_t *buf, int buf_size)
buf += 4;
do {
if (buf_end - buf < 4)
- return 0;
+ return AVERROR_INVALIDDATA;
flac_parse_block_header(buf, &metadata_last, NULL, &metadata_size);
buf += 4;
if (buf_end - buf < metadata_size) {
/* need more data in order to read the complete header */
- return 0;
+ return AVERROR_INVALIDDATA;
}
buf += metadata_size;
} while (!metadata_last);
More information about the ffmpeg-cvslog
mailing list