Re: [FFmpeg-devel] [PATCH] avformat/aacdec: account for small frame sizes.

2019-04-29 Thread Menno de Gier
On Mon, Apr 29, 2019 at 3:34 PM Hendrik Leppkes  wrote:
>
> On Mon, Apr 29, 2019 at 2:39 PM Menno de Gier  wrote:
> >
> > Some ADTS files have a first frame that's shorter than the 10 bytes that
> > are being read while checking for ID3 tags.
> >
> > Fixes #7271
> >
>
> James already send another patch for this issue -
> https://patchwork.ffmpeg.org/patch/12913/ - which seems to get by
> without seeks, which seems better. Maybe test that one?

Ah thanks, I missed that. Looks like a better patch indeed.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] avformat/aacdec: account for small frame sizes.

2019-04-29 Thread Hendrik Leppkes
On Mon, Apr 29, 2019 at 2:39 PM Menno de Gier  wrote:
>
> Some ADTS files have a first frame that's shorter than the 10 bytes that
> are being read while checking for ID3 tags.
>
> Fixes #7271
>

James already send another patch for this issue -
https://patchwork.ffmpeg.org/patch/12913/ - which seems to get by
without seeks, which seems better. Maybe test that one?

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH] avformat/aacdec: account for small frame sizes.

2019-04-29 Thread Menno de Gier
Some ADTS files have a first frame that's shorter than the 10 bytes that
are being read while checking for ID3 tags.

Fixes #7271

Signed-off-by: Menno de Gier 
---
 libavformat/aacdec.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/libavformat/aacdec.c b/libavformat/aacdec.c
index bd324a1420..25bccfbcb8 100644
--- a/libavformat/aacdec.c
+++ b/libavformat/aacdec.c
@@ -184,6 +184,15 @@ static int adts_aac_read_packet(AVFormatContext *s, 
AVPacket *pkt)
 return AVERROR_INVALIDDATA;
 }
 
+if (fsize < pkt->size) {
+ret = avio_seek(s->pb, fsize - pkt->size, SEEK_CUR);
+if (ret < 0) {
+av_packet_unref(pkt);
+return ret;
+}
+av_shrink_packet(pkt, fsize);
+}
+
 ret = av_append_packet(s->pb, pkt, fsize - pkt->size);
 if (ret < 0)
 av_packet_unref(pkt);
-- 
2.19.1

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".