[FFmpeg-cvslog] avcodec/vble: Allocate buffer later

Michael Niedermayer git at videolan.org
Tue Sep 24 17:40:30 EEST 2024


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sun Sep 22 23:05:28 2024 +0200| [03050a0d9092c57757a10b9e3c96e89e047d25bc] | committer: Michael Niedermayer

avcodec/vble: Allocate buffer later

Fixes: Timeout
Fixes: 71727/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VBLE_fuzzer-6126342574243840

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/vble.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavcodec/vble.c b/libavcodec/vble.c
index 4511433a6c..c48feb9a59 100644
--- a/libavcodec/vble.c
+++ b/libavcodec/vble.c
@@ -130,10 +130,6 @@ static int vble_decode_frame(AVCodecContext *avctx, AVFrame *pic,
         return AVERROR_INVALIDDATA;
     }
 
-    /* Allocate buffer */
-    if ((ret = ff_thread_get_buffer(avctx, pic, 0)) < 0)
-        return ret;
-
     /* Version should always be 1 */
     version = AV_RL32(src);
 
@@ -148,6 +144,10 @@ static int vble_decode_frame(AVCodecContext *avctx, AVFrame *pic,
         return AVERROR_INVALIDDATA;
     }
 
+    /* Allocate buffer */
+    if ((ret = ff_thread_get_buffer(avctx, pic, 0)) < 0)
+        return ret;
+
     /* Restore planes. Should be almost identical to Huffyuv's. */
     vble_restore_plane(ctx, pic, &gb, 0, offset, avctx->width, avctx->height);
 



More information about the ffmpeg-cvslog mailing list