diff mbox

[FFmpeg-devel] Fix to prevent runaway ac3 detection by looking at the actual frame rather than the first detected frame.

Message ID 20170128125230.87305-2-marijn@bitpit.net
State Accepted
Commit 227d602bb36f9460e007fb3e1fbff4a776838498
Headers show

Commit Message

Marijn Meijles Jan. 28, 2017, 12:52 p.m. UTC
Signed-off-by: Marijn Meijles <marijn@bitpit.net>
---
 libavformat/ac3dec.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Michael Niedermayer Jan. 28, 2017, 6:56 p.m. UTC | #1
On Sat, Jan 28, 2017 at 01:52:30PM +0100, Marijn Meijles wrote:
> Signed-off-by: Marijn Meijles <marijn@bitpit.net>
> ---
>  libavformat/ac3dec.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

the previous mail contains a description but the patch itself lacks
a commit message beyond the first line, the patch should contain a
commit message

[...]
diff mbox

Patch

diff --git a/libavformat/ac3dec.c b/libavformat/ac3dec.c
index 363a32e..e85b0ac 100644
--- a/libavformat/ac3dec.c
+++ b/libavformat/ac3dec.c
@@ -49,8 +49,8 @@  static int ac3_eac3_probe(AVProbeData *p, enum AVCodecID expected_codec_id)
                 buf2+=16;
             if (buf[0] == 0x77 && buf[1] == 0x0B) {
                 for(i=0; i<8; i+=2) {
-                    buf3[i  ] = buf[i+1];
-                    buf3[i+1] = buf[i  ];
+                    buf3[i  ] = buf2[i+1];
+                    buf3[i+1] = buf2[i  ];
                 }
                 init_get_bits(&gbc, buf3, 54);
             }else
@@ -62,8 +62,8 @@  static int ac3_eac3_probe(AVProbeData *p, enum AVCodecID expected_codec_id)
             if (buf[0] == 0x77 && buf[1] == 0x0B) {
                 av_assert0(phdr->frame_size <= sizeof(buf3));
                 for(i=8; i<phdr->frame_size; i+=2) {
-                    buf3[i  ] = buf[i+1];
-                    buf3[i+1] = buf[i  ];
+                    buf3[i  ] = buf2[i+1];
+                    buf3[i+1] = buf2[i  ];
                 }
             }
             if(av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0, gbc.buffer + 2, phdr->frame_size - 2))