diff mbox

[FFmpeg-devel,4/8] avformat/movenc: Check that frame_types other than EAC3_FRAME_TYPE_INDEPENDENT have a supported substream id

Message ID 20180627181121.30735-4-michael@niedermayer.cc
State New
Headers show

Commit Message

Michael Niedermayer June 27, 2018, 6:11 p.m. UTC
Fixes: out of array access
Fixes: ffmpeg_bof_1.avi

Found-by: Thuan Pham, Marcel Böhme, Andrew Santosa and Alexandru Razvan Caciulescu with AFLSmart
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavformat/movenc.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Michael Niedermayer June 28, 2018, 7:11 p.m. UTC | #1
On Wed, Jun 27, 2018 at 08:11:17PM +0200, Michael Niedermayer wrote:
> Fixes: out of array access
> Fixes: ffmpeg_bof_1.avi
> 
> Found-by: Thuan Pham, Marcel Böhme, Andrew Santosa and Alexandru Razvan Caciulescu with AFLSmart
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavformat/movenc.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> index e2c5613f98..00567db586 100644
> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -437,6 +437,12 @@ static int handle_eac3(MOVMuxContext *mov, AVPacket *pkt, MOVTrack *track)
>                  info->ec3_done = 1;
>                  goto concatenate;
>              }
> +        } else {
> +            if (hdr->substreamid != 0) {
> +                avpriv_request_sample(track->par, "Multiple dependent substreams");

Changed the wording to be more precisse and also fixed the copy and paste bug
in the context

will apply

[...]
diff mbox

Patch

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index e2c5613f98..00567db586 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -437,6 +437,12 @@  static int handle_eac3(MOVMuxContext *mov, AVPacket *pkt, MOVTrack *track)
                 info->ec3_done = 1;
                 goto concatenate;
             }
+        } else {
+            if (hdr->substreamid != 0) {
+                avpriv_request_sample(track->par, "Multiple dependent substreams");
+                ret = AVERROR_PATCHWELCOME;
+                goto end;
+            }
         }
 
         /* fill the info needed for the "dec3" atom */