[FFmpeg-cvslog] avcodec/mvha: fix warning: variable 'size' set but not used

Limin Wang git at videolan.org
Fri Dec 27 18:14:43 EET 2019


ffmpeg | branch: master | Limin Wang <lance.lmwang at gmail.com> | Fri Dec 27 23:58:35 2019 +0800| [93671d675597e685215a9ade4ddf7b00271f5767] | committer: James Almer

avcodec/mvha: fix warning: variable 'size' set but not used

Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
Signed-off-by: James Almer <jamrial at gmail.com>

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

 libavcodec/mvha.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/mvha.c b/libavcodec/mvha.c
index c270063b1c..afe5e511f2 100644
--- a/libavcodec/mvha.c
+++ b/libavcodec/mvha.c
@@ -161,6 +161,9 @@ static int decode_frame(AVCodecContext *avctx,
     type = AV_RB32(avpkt->data);
     size = AV_RL32(avpkt->data + 4);
 
+    if (size < 1 || size >= avpkt->size)
+        return AVERROR_INVALIDDATA;
+
     if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
         return ret;
 



More information about the ffmpeg-cvslog mailing list