[FFmpeg-cvslog] avcodec/gdv: Remove dead check

Andreas Rheinhardt git at videolan.org
Tue Nov 10 03:39:16 EET 2020


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Thu Nov  5 21:35:56 2020 +0100| [7e8306dd2da54fa499ea79a74f0ba81507e6c9d4] | committer: Andreas Rheinhardt

avcodec/gdv: Remove dead check

At the end of its decode function, the decoder sets *got_frame to 1 and
then checks whether ret is < 0; if so, it is returned, otherwise
avpkt->size is. But it is impossible for ret to be < 0 here and if it
were, it would be nonsense to set *got_frame to 1 before this. Therefore
just return avpkt->size unconditionally.

Fixes Coverity issue #1439730.

Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>

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

 libavcodec/gdv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/gdv.c b/libavcodec/gdv.c
index f00f3ac145..2be1e2ea7f 100644
--- a/libavcodec/gdv.c
+++ b/libavcodec/gdv.c
@@ -551,7 +551,7 @@ static int gdv_decode_frame(AVCodecContext *avctx, void *data,
 
     *got_frame = 1;
 
-    return ret < 0 ? ret : avpkt->size;
+    return avpkt->size;
 }
 
 static av_cold int gdv_decode_close(AVCodecContext *avctx)



More information about the ffmpeg-cvslog mailing list