[FFmpeg-cvslog] avcodec/zmbv: obtain frame later

2019-05-10 Thread Michael Niedermayer
ffmpeg | branch: release/3.2 | Michael Niedermayer  | 
Thu Feb 21 17:25:14 2019 +0100| [715b526d825a4bb4449d51c33ed31ee923b7d500] | 
committer: Michael Niedermayer

avcodec/zmbv: obtain frame later

The frame is not needed that early so obtaining it later avoids
the costly operation in case other checks fail.

Fixes: Timeout (14sec -> 4sec)
Fixes: 
13140/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ZMBV_fuzzer-5738330308739072

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Tomas Härdin 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 177b40890c6de8c6896e0a1d4a631ea1ca89c044)
Signed-off-by: Michael Niedermayer 

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

 libavcodec/zmbv.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/zmbv.c b/libavcodec/zmbv.c
index 46f59583c9..d6474075ee 100644
--- a/libavcodec/zmbv.c
+++ b/libavcodec/zmbv.c
@@ -519,9 +519,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, 
int *got_frame, AVPac
 return AVERROR_INVALIDDATA;
 }
 
-if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
-return ret;
-
 if (c->comp == 0) { // uncompressed data
 if (c->decomp_size < len) {
 av_log(avctx, AV_LOG_ERROR, "Buffer too small\n");
@@ -547,6 +544,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, 
int *got_frame, AVPac
 av_log(avctx, AV_LOG_ERROR, "decompressed size %d is incorrect, 
expected %d\n", c->decomp_len, expected_size);
 return AVERROR_INVALIDDATA;
 }
+if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
+return ret;
+
 if (c->flags & ZMBV_KEYFRAME) {
 frame->key_frame = 1;
 frame->pict_type = AV_PICTURE_TYPE_I;

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

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avcodec/zmbv: obtain frame later

2019-03-28 Thread Michael Niedermayer
ffmpeg | branch: release/3.4 | Michael Niedermayer  | 
Thu Feb 21 17:25:14 2019 +0100| [edf0297c6147453571c96042d0b09a45720dee3f] | 
committer: Michael Niedermayer

avcodec/zmbv: obtain frame later

The frame is not needed that early so obtaining it later avoids
the costly operation in case other checks fail.

Fixes: Timeout (14sec -> 4sec)
Fixes: 
13140/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ZMBV_fuzzer-5738330308739072

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Tomas Härdin 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 177b40890c6de8c6896e0a1d4a631ea1ca89c044)
Signed-off-by: Michael Niedermayer 

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

 libavcodec/zmbv.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/zmbv.c b/libavcodec/zmbv.c
index b994e96e95..6ef549dff1 100644
--- a/libavcodec/zmbv.c
+++ b/libavcodec/zmbv.c
@@ -519,9 +519,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, 
int *got_frame, AVPac
 return AVERROR_INVALIDDATA;
 }
 
-if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
-return ret;
-
 if (c->comp == 0) { // uncompressed data
 if (c->decomp_size < len) {
 av_log(avctx, AV_LOG_ERROR, "Buffer too small\n");
@@ -547,6 +544,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, 
int *got_frame, AVPac
 av_log(avctx, AV_LOG_ERROR, "decompressed size %d is incorrect, 
expected %d\n", c->decomp_len, expected_size);
 return AVERROR_INVALIDDATA;
 }
+if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
+return ret;
+
 if (c->flags & ZMBV_KEYFRAME) {
 frame->key_frame = 1;
 frame->pict_type = AV_PICTURE_TYPE_I;

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

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-cvslog] avcodec/zmbv: obtain frame later

2019-03-21 Thread Michael Niedermayer
ffmpeg | branch: release/4.0 | Michael Niedermayer  | 
Thu Feb 21 17:25:14 2019 +0100| [f32ce15f7c0beff43c060560de23daea2f353a7d] | 
committer: Michael Niedermayer

avcodec/zmbv: obtain frame later

The frame is not needed that early so obtaining it later avoids
the costly operation in case other checks fail.

Fixes: Timeout (14sec -> 4sec)
Fixes: 
13140/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ZMBV_fuzzer-5738330308739072

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Tomas Härdin 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 177b40890c6de8c6896e0a1d4a631ea1ca89c044)
Signed-off-by: Michael Niedermayer 

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

 libavcodec/zmbv.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/zmbv.c b/libavcodec/zmbv.c
index b994e96e95..6ef549dff1 100644
--- a/libavcodec/zmbv.c
+++ b/libavcodec/zmbv.c
@@ -519,9 +519,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, 
int *got_frame, AVPac
 return AVERROR_INVALIDDATA;
 }
 
-if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
-return ret;
-
 if (c->comp == 0) { // uncompressed data
 if (c->decomp_size < len) {
 av_log(avctx, AV_LOG_ERROR, "Buffer too small\n");
@@ -547,6 +544,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, 
int *got_frame, AVPac
 av_log(avctx, AV_LOG_ERROR, "decompressed size %d is incorrect, 
expected %d\n", c->decomp_len, expected_size);
 return AVERROR_INVALIDDATA;
 }
+if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
+return ret;
+
 if (c->flags & ZMBV_KEYFRAME) {
 frame->key_frame = 1;
 frame->pict_type = AV_PICTURE_TYPE_I;

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


[FFmpeg-cvslog] avcodec/zmbv: obtain frame later

2019-03-13 Thread Michael Niedermayer
ffmpeg | branch: release/4.1 | Michael Niedermayer  | 
Thu Feb 21 17:25:14 2019 +0100| [ff491b15444238db26aa7c842d94eb7c1e7bc82c] | 
committer: Michael Niedermayer

avcodec/zmbv: obtain frame later

The frame is not needed that early so obtaining it later avoids
the costly operation in case other checks fail.

Fixes: Timeout (14sec -> 4sec)
Fixes: 
13140/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ZMBV_fuzzer-5738330308739072

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Tomas Härdin 
Signed-off-by: Michael Niedermayer 
(cherry picked from commit 177b40890c6de8c6896e0a1d4a631ea1ca89c044)
Signed-off-by: Michael Niedermayer 

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

 libavcodec/zmbv.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/zmbv.c b/libavcodec/zmbv.c
index 79e0892070..e07009d0fb 100644
--- a/libavcodec/zmbv.c
+++ b/libavcodec/zmbv.c
@@ -525,9 +525,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, 
int *got_frame, AVPac
 return AVERROR_INVALIDDATA;
 }
 
-if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
-return ret;
-
 if (c->comp == 0) { // uncompressed data
 if (c->decomp_size < len) {
 av_log(avctx, AV_LOG_ERROR, "Buffer too small\n");
@@ -553,6 +550,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, 
int *got_frame, AVPac
 av_log(avctx, AV_LOG_ERROR, "decompressed size %d is incorrect, 
expected %d\n", c->decomp_len, expected_size);
 return AVERROR_INVALIDDATA;
 }
+if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
+return ret;
+
 if (c->flags & ZMBV_KEYFRAME) {
 frame->key_frame = 1;
 frame->pict_type = AV_PICTURE_TYPE_I;

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


[FFmpeg-cvslog] avcodec/zmbv: obtain frame later

2019-02-23 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Thu 
Feb 21 17:25:14 2019 +0100| [177b40890c6de8c6896e0a1d4a631ea1ca89c044] | 
committer: Michael Niedermayer

avcodec/zmbv: obtain frame later

The frame is not needed that early so obtaining it later avoids
the costly operation in case other checks fail.

Fixes: Timeout (14sec -> 4sec)
Fixes: 
13140/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ZMBV_fuzzer-5738330308739072

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

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

 libavcodec/zmbv.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/zmbv.c b/libavcodec/zmbv.c
index 79e0892070..e07009d0fb 100644
--- a/libavcodec/zmbv.c
+++ b/libavcodec/zmbv.c
@@ -525,9 +525,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, 
int *got_frame, AVPac
 return AVERROR_INVALIDDATA;
 }
 
-if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
-return ret;
-
 if (c->comp == 0) { // uncompressed data
 if (c->decomp_size < len) {
 av_log(avctx, AV_LOG_ERROR, "Buffer too small\n");
@@ -553,6 +550,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, 
int *got_frame, AVPac
 av_log(avctx, AV_LOG_ERROR, "decompressed size %d is incorrect, 
expected %d\n", c->decomp_len, expected_size);
 return AVERROR_INVALIDDATA;
 }
+if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
+return ret;
+
 if (c->flags & ZMBV_KEYFRAME) {
 frame->key_frame = 1;
 frame->pict_type = AV_PICTURE_TYPE_I;

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