comparison dv.c @ 9855:756ac43c7fd9 libavcodec

check if frame size matches old sys and assumes corrupted input, fixes #1192
author bcoudurier
date Sun, 14 Jun 2009 22:34:28 +0000
parents e52891e48ceb
children ff2358195bc7
comparison
equal deleted inserted replaced
9854:2428d32533f6 9855:756ac43c7fd9
1117 { 1117 {
1118 const uint8_t *buf = avpkt->data; 1118 const uint8_t *buf = avpkt->data;
1119 int buf_size = avpkt->size; 1119 int buf_size = avpkt->size;
1120 DVVideoContext *s = avctx->priv_data; 1120 DVVideoContext *s = avctx->priv_data;
1121 1121
1122 s->sys = dv_frame_profile(buf); 1122 s->sys = dv_frame_profile(s->sys, buf, buf_size);
1123 if (!s->sys || buf_size < s->sys->frame_size || dv_init_dynamic_tables(s->sys)) 1123 if (!s->sys || buf_size < s->sys->frame_size || dv_init_dynamic_tables(s->sys))
1124 return -1; /* NOTE: we only accept several full frames */ 1124 return -1; /* NOTE: we only accept several full frames */
1125 1125
1126 if (s->picture.data[0]) 1126 if (s->picture.data[0])
1127 avctx->release_buffer(avctx, &s->picture); 1127 avctx->release_buffer(avctx, &s->picture);