[FFmpeg-cvslog] libopenh264dec: Fix cleanup if the init failed early

Martin Storsjö git at videolan.org
Fri Nov 18 11:44:44 EET 2016


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Thu Jul 14 22:03:16 2016 +0300| [d0b1e6049b06eeeeca146ece4d2f199c5dba1565] | committer: Martin Storsjö

libopenh264dec: Fix cleanup if the init failed early

Signed-off-by: Martin Storsjö <martin at martin.st>

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

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

diff --git a/libavcodec/libopenh264dec.c b/libavcodec/libopenh264dec.c
index cdbea7b..a105fa5 100644
--- a/libavcodec/libopenh264dec.c
+++ b/libavcodec/libopenh264dec.c
@@ -48,7 +48,7 @@ static av_cold int svc_decode_close(AVCodecContext *avctx)
     if (s->decoder)
         WelsDestroyDecoder(s->decoder);
 
-    while (av_fifo_size(s->packet_fifo) >= sizeof(pkt)) {
+    while (s->packet_fifo && av_fifo_size(s->packet_fifo) >= sizeof(pkt)) {
         av_fifo_generic_read(s->packet_fifo, &pkt, sizeof(pkt), NULL);
         av_packet_unref(&pkt);
     }



More information about the ffmpeg-cvslog mailing list