History

dvenc: Validate the frame size before copying it

Luca Barbato committed 11 years ago

Commit f7986231 parent 71394891 file · +5 −0Browse files

Unified · Split

libavformat/dvenc.c+5−0
@@ -249,6 +249,11 @@ static int dv_assemble_frame(DVMuxContext *c, AVStream* st, · 248 unmodified lines
249 /* FIXME: we have to have more sensible approach than this one */249 /* FIXME: we have to have more sensible approach than this one */
250 if (c->has_video)250 if (c->has_video)
251 av_log(st->codec, AV_LOG_ERROR, "Can't process DV frame #%d. Insufficient audio data or severe sync problem.\n", c->frames);251 av_log(st->codec, AV_LOG_ERROR, "Can't process DV frame #%d. Insufficient audio data or severe sync problem.\n", c->frames);
252 if (data_size != c->sys->frame_size) {
253 av_log(st->codec, AV_LOG_ERROR, "Unexpected frame size, %d != %d\n",
254 data_size, c->sys->frame_size);
255 return AVERROR(ENOSYS);
256 }
252 257
253 memcpy(*frame, data, c->sys->frame_size);258 memcpy(*frame, data, c->sys->frame_size);
254 c->has_video = 1;259 c->has_video = 1;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t