]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/gdv: Remove dead check
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Thu, 5 Nov 2020 20:35:56 +0000 (21:35 +0100)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Tue, 10 Nov 2020 01:14:29 +0000 (02:14 +0100)
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@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavcodec/gdv.c

index f00f3ac1458378b4332668c048230049226102f6..2be1e2ea7fd1e9f7fa437573db2b9337f7971862 100644 (file)
@@ -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)