From d509c743b78da198af385fea362b632292cd00ad Mon Sep 17 00:00:00 2001 From: Baptiste Coudurier Date: Sun, 14 Jun 2009 22:34:28 +0000 Subject: check if frame size matches old sys and assumes corrupted input, fixes #1192 Originally committed as revision 19192 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/dvdata.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'libavcodec/dvdata.h') diff --git a/libavcodec/dvdata.h b/libavcodec/dvdata.h index 21023cfe59..a32b863c5d 100644 --- a/libavcodec/dvdata.h +++ b/libavcodec/dvdata.h @@ -698,7 +698,9 @@ enum dv_pack_type { */ #define DV_MAX_BPM 8 -static inline const DVprofile* dv_frame_profile(const uint8_t* frame) +static inline +const DVprofile* dv_frame_profile(const DVprofile *sys, + const uint8_t* frame, unsigned buf_size) { int i; @@ -715,6 +717,10 @@ static inline const DVprofile* dv_frame_profile(const uint8_t* frame) if (dsf == dv_profiles[i].dsf && stype == dv_profiles[i].video_stype) return &dv_profiles[i]; + /* check if old sys matches and assumes corrupted input */ + if (sys && buf_size == sys->frame_size) + return sys; + return NULL; } -- cgit v1.2.3