[FFmpeg-devel] [PATCH] avformat/mov: Fix reading saio/saiz for clear content.

Jacob Trimble modmaker at google.com
Thu Jun 7 23:42:51 EEST 2018


On Thu, Jun 7, 2018 at 10:38 AM Jacob Trimble <modmaker at google.com> wrote:
>
> Found by Chrome's ClusterFuzz: http://crbug.com/850389
>
> Signed-off-by: Jacob Trimble <modmaker at google.com>
> ---
>  libavformat/mov.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/libavformat/mov.c b/libavformat/mov.c
> index 4ad19122b3..d07171b3f4 100644
> --- a/libavformat/mov.c
> +++ b/libavformat/mov.c
> @@ -6041,6 +6041,11 @@ static int mov_read_saiz(MOVContext *c, AVIOContext *pb, MOVAtom atom)
>      if (ret != 1)
>          return ret;
>
> +    if (!sc->cenc.default_encrypted_sample) {
> +        // Didn't see a 'schm' or 'tenc' atom, so it isn't encrypted.
> +        return 0;
> +    }
> +
>      if (encryption_index->nb_encrypted_samples) {
>          // This can happen if we have both saio/saiz and senc atoms.
>          av_log(c->fc, AV_LOG_DEBUG, "Ignoring duplicate encryption info in saiz\n");
> @@ -6095,6 +6100,11 @@ static int mov_read_saio(MOVContext *c, AVIOContext *pb, MOVAtom atom)
>      if (ret != 1)
>          return ret;
>
> +    if (!sc->cenc.default_encrypted_sample) {
> +        // Didn't see a 'schm' or 'tenc' atom, so it isn't encrypted.
> +        return 0;
> +    }
> +
>      if (encryption_index->nb_encrypted_samples) {
>          // This can happen if we have both saio/saiz and senc atoms.
>          av_log(c->fc, AV_LOG_DEBUG, "Ignoring duplicate encryption info in saio\n");
> --
> 2.17.1.1185.g55be947832-goog
>

Based on comments downstream, I've added error checks for the
encrypted type of saio/saiz atoms.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-avformat-mov-Fix-reading-saio-saiz-for-clear-content-v2.patch
Type: text/x-patch
Size: 5309 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180607/6ea59238/attachment.bin>


More information about the ffmpeg-devel mailing list