[vlc-devel] [PATCH 12/12] avcodec: signal DECODER_STATE_ERROR_INPUT when data is not valid

Thomas Guillem thomas at gllm.fr
Thu Jun 9 11:52:04 CEST 2016


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

diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index 1e6b3df..a31d608 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -781,6 +781,8 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
                 if( b_drawpicture )
                     msg_Warn( p_dec, "cannot decode one frame (%zu bytes)",
                             p_block->i_buffer );
+                if( i_used == AVERROR_INVALIDDATA )
+                    decoder_AddState( p_dec, DECODER_STATE_ERROR_INPUT );
                 break;
             }
             else if( (unsigned)i_used > p_block->i_buffer ||
-- 
2.8.1



More information about the vlc-devel mailing list