[FFmpeg-devel] [PATCH 2/4] mov: check for positive sample->size

Michael Niedermayer michaelni at gmx.at
Sun May 24 00:46:28 CEST 2015


On Sun, May 24, 2015 at 12:04:23AM +0200, Andreas Cadhalpun wrote:
> Without this the mov demuxer can return a large number of empty packets.
> 
> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
> ---
>  libavformat/mov.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/libavformat/mov.c b/libavformat/mov.c
> index f6f07be..a6290d1 100644
> --- a/libavformat/mov.c
> +++ b/libavformat/mov.c
> @@ -4260,6 +4260,11 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
>          sample->size = FFMIN(sample->size, (mov->next_root_atom - sample->pos));
>      }
>  
> +    if (!sample->size) {
> +        av_log(s, AV_LOG_ERROR, "sample size is zero\n");
> +        return AVERROR_INVALIDDATA;
> +    }

this would cause failure to demux future packets, i think its
better to skip this but continue without failing

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150524/9757e88d/attachment.asc>


More information about the ffmpeg-devel mailing list