diff options
author | van <[email protected]> | 2008-11-18 04:24:11 +0000 |
---|---|---|
committer | van <[email protected]> | 2008-11-18 04:24:11 +0000 |
commit | f79cf588ca98c7f34f38194501725891b82feeb5 (patch) | |
tree | 9cd259eb2a3d8069bbf9501211efdd5b382d09d3 | |
parent | 6d6b8677bb42c3b7e2e82a112de57f3d42191bf4 (diff) |
Don't abort when the ffmpeg vc1 decoder hands us a bogus packet size
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1925 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rwxr-xr-x | libhb/stream.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libhb/stream.c b/libhb/stream.c index 0a336ec27..e531d6002 100755 --- a/libhb/stream.c +++ b/libhb/stream.c @@ -2685,6 +2685,13 @@ static int ffmpeg_read( hb_stream_t *stream, hb_buffer_t *buf ) { if ( stream->ffmpeg_pkt->size > buf->alloc ) { + // sometimes we get absurd sizes from ffmpeg + if ( stream->ffmpeg_pkt->size >= (1 << 25) ) + { + hb_log( "ffmpeg_read: pkt too big: %d bytes", stream->ffmpeg_pkt->size ); + av_free_packet( stream->ffmpeg_pkt ); + return ffmpeg_read( stream, buf ); + } // need to expand buffer hb_buffer_realloc( buf, stream->ffmpeg_pkt->size ); } |