From 1ae406bfee47934bde76f95e0ebc0c1de099bcd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Sat, 17 Jun 2006 12:47:53 +0000 Subject: Fix mpeg2 decoding with ffmpeg, thanks to Christer Palm (palm@nogui.se). CVS patchset: 8046 CVS date: 2006/06/17 12:47:53 --- src/libffmpeg/libavcodec/mpegvideo.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/libffmpeg/libavcodec/mpegvideo.c b/src/libffmpeg/libavcodec/mpegvideo.c index 3ecf6d29d..77d6691af 100644 --- a/src/libffmpeg/libavcodec/mpegvideo.c +++ b/src/libffmpeg/libavcodec/mpegvideo.c @@ -239,6 +239,9 @@ void ff_write_quant_matrix(PutBitContext *pb, int16_t *matrix){ const uint8_t *ff_find_start_code(const uint8_t * restrict p, const uint8_t *end, uint32_t * restrict state){ int i; + if(p>=end) + return end; + for(i=0; i<3; i++){ uint32_t tmp= *state << 8; *state= tmp + *(p++); -- cgit v1.2.3