[vlc-commits] avcodec: fix null-dereference on drain

Thomas Guillem git at videolan.org
Wed Sep 7 12:10:02 CEST 2016


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Sep  7 12:08:47 2016 +0200| [e00a1a96c9456fda093e659ecfeacd6c9f6a63d0] | committer: Thomas Guillem

avcodec: fix null-dereference on drain

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

 modules/codec/avcodec/video.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index 3448c1a..f236224 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -834,10 +834,10 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
         }
 
         int not_able_to_send_packet = avcodec_send_packet( p_context, &pkt );
+        i_used = pkt.size;
         av_packet_unref( &pkt );
 
         int not_received_frame = avcodec_receive_frame( p_context, frame);
-        i_used = p_block->i_size;
 
         wait_mt( p_sys );
 



More information about the vlc-commits mailing list