Re: [FFmpeg-devel] [PATCH 1/2] avcodec/eac3: add support for dependent stream

2018-03-29 Thread James Almer
On 3/28/2018 3:59 PM, Paul B Mahol wrote:
> Signed-off-by: Paul B Mahol 
> ---
>  libavcodec/aac_ac3_parser.c |   9 ++-
>  libavcodec/ac3_parser.c |   2 +-
>  libavcodec/ac3dec.c | 177 
> +++-
>  libavcodec/ac3dec.h |  10 ++-
>  libavcodec/eac3dec.c|  11 +--
>  tests/ref/fate/ts-demux |   2 +-
>  tests/ref/seek/lavf-rm  |   6 +-
>  7 files changed, 164 insertions(+), 53 deletions(-)
> 

> @@ -1463,14 +1483,17 @@ static int ac3_decode_frame(AVCodecContext * avctx, 
> void *data,
>  {
>  AVFrame *frame = data;
>  const uint8_t *buf = avpkt->data;
> -int buf_size = avpkt->size;
> +int buf_size, full_buf_size = avpkt->size;
>  AC3DecodeContext *s = avctx->priv_data;
> -int blk, ch, err, ret;
> +int blk, ch, err, offset, ret;
> +int got_independent_frame = 0;
>  const uint8_t *channel_map;
> +uint8_t extended_channel_map[AC3_MAX_CHANNELS * 2];

AC3_MAX_CHANNELS is 7

[...]

> +for (ch = 0; ch < 16; ch++)
> +extended_channel_map[ch] = ch;

Which means an out of array access takes place here.

This is making all ac3 and eac3 tests crash with SIGABRT on Linux GCC
when -fstack-protector is enabled (which is on by default).

http://fate.ffmpeg.org/report.cgi?time=20180329202433=x86_64-archlinux-gcc-threads-auto

[...]

> @@ -239,11 +242,12 @@ typedef struct AC3DecodeContext {
>  ///@name Aligned arrays
>  DECLARE_ALIGNED(16, int,   
> fixed_coeffs)[AC3_MAX_CHANNELS][AC3_MAX_COEFS];   ///< fixed-point 
> transform coefficients
>  DECLARE_ALIGNED(32, INTFLOAT, 
> transform_coeffs)[AC3_MAX_CHANNELS][AC3_MAX_COEFS];   ///< transform 
> coefficients
> -DECLARE_ALIGNED(32, INTFLOAT, delay)[AC3_MAX_CHANNELS][AC3_BLOCK_SIZE];  
>///< delay - added to the next block
> +DECLARE_ALIGNED(32, INTFLOAT, delay)[2 * 
> AC3_MAX_CHANNELS][AC3_BLOCK_SIZE]; ///< delay - added to the next 
> block
>  DECLARE_ALIGNED(32, INTFLOAT, window)[AC3_BLOCK_SIZE];   
>///< window coefficients
>  DECLARE_ALIGNED(32, INTFLOAT, tmp_output)[AC3_BLOCK_SIZE];   
>///< temporary storage for output before windowing
> -DECLARE_ALIGNED(32, SHORTFLOAT, 
> output)[AC3_MAX_CHANNELS][AC3_BLOCK_SIZE];///< output after imdct 
> transform and windowing
> +DECLARE_ALIGNED(32, SHORTFLOAT, output)[2 * 
> AC3_MAX_CHANNELS][AC3_BLOCK_SIZE];///< output after imdct 
> transform and windowing
>  DECLARE_ALIGNED(32, uint8_t, input_buffer)[AC3_FRAME_BUFFER_SIZE + 
> AV_INPUT_BUFFER_PADDING_SIZE]; ///< temp buffer to prevent overread
> +DECLARE_ALIGNED(32, SHORTFLOAT, output_buffer)[2 * 
> AC3_MAX_CHANNELS][AC3_BLOCK_SIZE * 6];  ///< final output buffer

Not sure if the same happens with these, but better make sure.

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/2] avcodec/eac3: add support for dependent stream

2018-03-28 Thread Paul B Mahol
On 3/28/18, Michael Niedermayer  wrote:
> On Tue, Mar 27, 2018 at 10:55:05PM +0200, Paul B Mahol wrote:
>> Signed-off-by: Paul B Mahol 
>> ---
>>  libavcodec/aac_ac3_parser.c |   9 ++-
>>  libavcodec/ac3_parser.c |   2 +-
>>  libavcodec/ac3dec.c | 177
>> +++-
>>  libavcodec/ac3dec.h |  10 ++-
>>  libavcodec/eac3dec.c|  11 +--
>>  5 files changed, 160 insertions(+), 49 deletions(-)
>
> this changes fate:
> h264
> TESTfifo-muxer-wav
> TESTfilter-owdenoise-sample
> --- ./tests/ref/fate/ts-demux 2018-03-26 22:16:55.300383350 +0200
> +++ tests/data/fate/ts-demux  2018-03-28 00:36:45.599977471 +0200
> @@ -13,7 +13,7 @@
>  1,  0,  0, 2880, 1536, 0x773ffeea, S=1,1,
> 0x00bd00bd
>  1,   2880,   2880, 2880, 1536, 0x6dc10748
>  1,   5760,   5760, 2880, 1536, 0xbab5129c
> -1,   8640,   8640, 2880, 1536, 0x602f034b
> +1,   8640,   8640, 2880, 1536, 0x602f034b, S=1,1,
> 0x00bd00bd
>  1,  11520,  11520, 2880,  906, 0x69cdcbcd
>  0,  32037,  36541, 1501,   114336, 0x37a215a8, S=1,1,
> 0x00e000e0
>  0,  33538,  33538, 1501,12560, 0xb559a3d4, F=0x0, S=1,
>   1, 0x00e000e0
> TESTfilter-delogo
> Test ts-demux failed. Look at tests/data/fate/ts-demux.err for details.
> make: *** [fate-ts-demux] Error 1
> make: *** Waiting for unfinished jobs

Fixed locally. Updated fate ref.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/2] avcodec/eac3: add support for dependent stream

2018-03-27 Thread Michael Niedermayer
On Tue, Mar 27, 2018 at 10:55:05PM +0200, Paul B Mahol wrote:
> Signed-off-by: Paul B Mahol 
> ---
>  libavcodec/aac_ac3_parser.c |   9 ++-
>  libavcodec/ac3_parser.c |   2 +-
>  libavcodec/ac3dec.c | 177 
> +++-
>  libavcodec/ac3dec.h |  10 ++-
>  libavcodec/eac3dec.c|  11 +--
>  5 files changed, 160 insertions(+), 49 deletions(-)

this changes fate:
h264
TESTfifo-muxer-wav
TESTfilter-owdenoise-sample
--- ./tests/ref/fate/ts-demux   2018-03-26 22:16:55.300383350 +0200
+++ tests/data/fate/ts-demux2018-03-28 00:36:45.599977471 +0200
@@ -13,7 +13,7 @@
 1,  0,  0, 2880, 1536, 0x773ffeea, S=1,1, 
0x00bd00bd
 1,   2880,   2880, 2880, 1536, 0x6dc10748
 1,   5760,   5760, 2880, 1536, 0xbab5129c
-1,   8640,   8640, 2880, 1536, 0x602f034b
+1,   8640,   8640, 2880, 1536, 0x602f034b, S=1,1, 
0x00bd00bd
 1,  11520,  11520, 2880,  906, 0x69cdcbcd
 0,  32037,  36541, 1501,   114336, 0x37a215a8, S=1,1, 
0x00e000e0
 0,  33538,  33538, 1501,12560, 0xb559a3d4, F=0x0, S=1,
1, 0x00e000e0
TESTfilter-delogo
Test ts-demux failed. Look at tests/data/fate/ts-demux.err for details.
make: *** [fate-ts-demux] Error 1
make: *** Waiting for unfinished jobs


[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 2
"100% positive feedback" - "All either got their money back or didnt complain"
"Best seller ever, very honest" - "Seller refunded buyer after failed scam"


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel