summaryrefslogtreecommitdiff
path: root/libavcodec/proresdec_lgpl.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-10-16 03:44:00 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-10-16 04:02:09 +0200
commit2822361ed1fe18b03a35dfdbda811de6bd919e0a (patch)
tree353c0ad65fd1a4c151e2c7cb02c415f56b8e75eb /libavcodec/proresdec_lgpl.c
parent647ec6fc0308ccfc86ad48b1d7d20d85ddf6825c (diff)
parent91038cdbd160310174aad6833d1d08c65d850e78 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: prores: get correct size for coded V plane if alpha is present prores: do not set pixel format on codec init pthread: prevent updating AVCodecContext from itself in frame_thread_free pthread: copy coded frame dimensions in update_context_from_thread vp8: prevent read from uninitialized memory in decode_mvs vp8: force reallocation in update_thread_context after frame size change vp8: fix return value if update_dimensions fails matroskadec: fix out of bounds write adpcmdec: calculate actual number of output samples for each decoder. adpcmdec: check remaining buffer size before decoding next block in the ADPCM IMA WAV decoder. adpcmdec: do not terminate early in ADPCM IMA Duck DK3 decoder. adpcmdec: remove unneeded buf_size==0 check. adpcmdec: remove unneeded zeroing of *data_size dnxhdenc: fixed signed multiplication overflow Conflicts: tests/ref/fate/prores-alpha tests/ref/fate/truemotion1-24 Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/proresdec_lgpl.c')
-rw-r--r--libavcodec/proresdec_lgpl.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/proresdec_lgpl.c b/libavcodec/proresdec_lgpl.c
index f67db6cc92..84d81ee425 100644
--- a/libavcodec/proresdec_lgpl.c
+++ b/libavcodec/proresdec_lgpl.c
@@ -105,8 +105,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
ctx->total_slices = 0;
ctx->slice_data = NULL;
- avctx->pix_fmt = PIX_FMT_YUV422P10; // set default pixel format
-
avctx->bits_per_raw_sample = PRORES_BITS_PER_SAMPLE;
ff_proresdsp_init(&ctx->dsp, avctx);
@@ -548,9 +546,11 @@ static int decode_slice(AVCodecContext *avctx, ProresThreadData *td)
hdr_size = buf[0] >> 3;
y_data_size = AV_RB16(buf + 2);
u_data_size = AV_RB16(buf + 4);
- v_data_size = slice_data_size - y_data_size - u_data_size - hdr_size;
+ v_data_size = hdr_size > 7 ? AV_RB16(buf + 6) :
+ slice_data_size - y_data_size - u_data_size - hdr_size;
- if (v_data_size < 0 || hdr_size < 6) {
+ if (hdr_size + y_data_size + u_data_size + v_data_size > slice_data_size ||
+ v_data_size < 0 || hdr_size < 6) {
av_log(avctx, AV_LOG_ERROR, "invalid data size\n");
return AVERROR_INVALIDDATA;
}