[FFmpeg-cvslog] avcodec/cscd: Error out when LZ* decompression fails

2018-07-10 Thread Michael Niedermayer
ffmpeg | branch: release/2.8 | Michael Niedermayer  | 
Mon Mar 12 00:05:04 2018 +0100| [704bebc91fa573dd770e49b805e1a9d7f68fea6f] | 
committer: Michael Niedermayer

avcodec/cscd: Error out when LZ* decompression fails

Fixes: Timeout
Fixes: 
6304/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CSCD_fuzzer-5754772461191168

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
(cherry picked from commit d52be5d4e91871a22dac70af3e0ab429e95a2d10)
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=704bebc91fa573dd770e49b805e1a9d7f68fea6f
---

 libavcodec/cscd.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/libavcodec/cscd.c b/libavcodec/cscd.c
index 278093fdb3..8cb193de56 100644
--- a/libavcodec/cscd.c
+++ b/libavcodec/cscd.c
@@ -81,15 +81,19 @@ static int decode_frame(AVCodecContext *avctx, void *data, 
int *got_frame,
 switch ((buf[0] >> 1) & 7) {
 case 0: { // lzo compression
 int outlen = c->decomp_size, inlen = buf_size - 2;
-if (av_lzo1x_decode(c->decomp_buf, , [2], ))
+if (av_lzo1x_decode(c->decomp_buf, , [2], )) {
 av_log(avctx, AV_LOG_ERROR, "error during lzo 
decompression\n");
+return AVERROR_INVALIDDATA;
+}
 break;
 }
 case 1: { // zlib compression
 #if CONFIG_ZLIB
 unsigned long dlen = c->decomp_size;
-if (uncompress(c->decomp_buf, , [2], buf_size - 2) != 
Z_OK)
+if (uncompress(c->decomp_buf, , [2], buf_size - 2) != 
Z_OK) {
 av_log(avctx, AV_LOG_ERROR, "error during zlib 
decompression\n");
+return AVERROR_INVALIDDATA;
+}
 break;
 #else
 av_log(avctx, AV_LOG_ERROR, "compiled without zlib support\n");

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avcodec/cscd: Error out when LZ* decompression fails

2018-04-12 Thread Michael Niedermayer
ffmpeg | branch: release/3.3 | Michael Niedermayer  | 
Mon Mar 12 00:05:04 2018 +0100| [1d3c141af4f0fa693cf86d0d7a70265beace4cb5] | 
committer: Michael Niedermayer

avcodec/cscd: Error out when LZ* decompression fails

Fixes: Timeout
Fixes: 
6304/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CSCD_fuzzer-5754772461191168

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
(cherry picked from commit d52be5d4e91871a22dac70af3e0ab429e95a2d10)
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1d3c141af4f0fa693cf86d0d7a70265beace4cb5
---

 libavcodec/cscd.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/libavcodec/cscd.c b/libavcodec/cscd.c
index 9e1dec9d96..35c4ee08c3 100644
--- a/libavcodec/cscd.c
+++ b/libavcodec/cscd.c
@@ -81,15 +81,19 @@ static int decode_frame(AVCodecContext *avctx, void *data, 
int *got_frame,
 switch ((buf[0] >> 1) & 7) {
 case 0: { // lzo compression
 int outlen = c->decomp_size, inlen = buf_size - 2;
-if (av_lzo1x_decode(c->decomp_buf, , [2], ))
+if (av_lzo1x_decode(c->decomp_buf, , [2], )) {
 av_log(avctx, AV_LOG_ERROR, "error during lzo 
decompression\n");
+return AVERROR_INVALIDDATA;
+}
 break;
 }
 case 1: { // zlib compression
 #if CONFIG_ZLIB
 unsigned long dlen = c->decomp_size;
-if (uncompress(c->decomp_buf, , [2], buf_size - 2) != 
Z_OK)
+if (uncompress(c->decomp_buf, , [2], buf_size - 2) != 
Z_OK) {
 av_log(avctx, AV_LOG_ERROR, "error during zlib 
decompression\n");
+return AVERROR_INVALIDDATA;
+}
 break;
 #else
 av_log(avctx, AV_LOG_ERROR, "compiled without zlib support\n");

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] avcodec/cscd: Error out when LZ* decompression fails

2018-04-02 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Mon 
Mar 12 00:05:04 2018 +0100| [d52be5d4e91871a22dac70af3e0ab429e95a2d10] | 
committer: Michael Niedermayer

avcodec/cscd: Error out when LZ* decompression fails

Fixes: Timeout
Fixes: 
6304/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CSCD_fuzzer-5754772461191168

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d52be5d4e91871a22dac70af3e0ab429e95a2d10
---

 libavcodec/cscd.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/libavcodec/cscd.c b/libavcodec/cscd.c
index 9e1dec9d96..35c4ee08c3 100644
--- a/libavcodec/cscd.c
+++ b/libavcodec/cscd.c
@@ -81,15 +81,19 @@ static int decode_frame(AVCodecContext *avctx, void *data, 
int *got_frame,
 switch ((buf[0] >> 1) & 7) {
 case 0: { // lzo compression
 int outlen = c->decomp_size, inlen = buf_size - 2;
-if (av_lzo1x_decode(c->decomp_buf, , [2], ))
+if (av_lzo1x_decode(c->decomp_buf, , [2], )) {
 av_log(avctx, AV_LOG_ERROR, "error during lzo 
decompression\n");
+return AVERROR_INVALIDDATA;
+}
 break;
 }
 case 1: { // zlib compression
 #if CONFIG_ZLIB
 unsigned long dlen = c->decomp_size;
-if (uncompress(c->decomp_buf, , [2], buf_size - 2) != 
Z_OK)
+if (uncompress(c->decomp_buf, , [2], buf_size - 2) != 
Z_OK) {
 av_log(avctx, AV_LOG_ERROR, "error during zlib 
decompression\n");
+return AVERROR_INVALIDDATA;
+}
 break;
 #else
 av_log(avctx, AV_LOG_ERROR, "compiled without zlib support\n");

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog