comparison tmv.c @ 9663:041c635d0f69 libavcodec

Make TMV decoder check packet sizes before reading from it. FATE test 295 might need updating.
author vitor
date Sun, 17 May 2009 09:48:12 +0000
parents fe6e82906aa8
children 569849bc0f40
comparison
equal deleted inserted replaced
9662:34be4ff86302 9663:041c635d0f69
50 if (avctx->get_buffer(avctx, &tmv->pic) < 0) { 50 if (avctx->get_buffer(avctx, &tmv->pic) < 0) {
51 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); 51 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
52 return -1; 52 return -1;
53 } 53 }
54 54
55 if (avpkt->size < 2*char_rows*char_cols) {
56 av_log(avctx, AV_LOG_ERROR,
57 "Input buffer too small, truncated sample?\n");
58 *data_size = 0;
59 return -1;
60 }
61
55 tmv->pic.pict_type = FF_I_TYPE; 62 tmv->pic.pict_type = FF_I_TYPE;
56 tmv->pic.key_frame = 1; 63 tmv->pic.key_frame = 1;
57 dst = tmv->pic.data[0]; 64 dst = tmv->pic.data[0];
58 65
59 tmv->pic.palette_has_changed = 1; 66 tmv->pic.palette_has_changed = 1;