summaryrefslogtreecommitdiffstats
path: root/libavcodec/dvdata.h
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2009-06-14 22:34:28 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2009-06-14 22:34:28 +0000
commitd509c743b78da198af385fea362b632292cd00ad (patch)
tree2d60542133f640febd6111a0048c79b6d923095c /libavcodec/dvdata.h
parent90b4f091770b38b803ce63a9dba2c03b643e732d (diff)
downloadffmpeg-streaming-d509c743b78da198af385fea362b632292cd00ad.zip
ffmpeg-streaming-d509c743b78da198af385fea362b632292cd00ad.tar.gz
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
Diffstat (limited to 'libavcodec/dvdata.h')
-rw-r--r--libavcodec/dvdata.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/libavcodec/dvdata.h b/libavcodec/dvdata.h
index 21023cf..a32b863 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;
}
OpenPOWER on IntegriCloud