diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-03-27 02:11:03 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-03-27 02:17:54 +0200 |
commit | 8b58f6b5c286ba14ec9c6c9e03f9ede8c6be9181 (patch) | |
tree | 369a2b6ae26809215a8776d7a62c3b6830365159 /libavcodec/rawdec.c | |
parent | 7f9b42ff9d9d36f39c7a8aa26b63ff47f34bd17b (diff) | |
download | ffmpeg-streaming-8b58f6b5c286ba14ec9c6c9e03f9ede8c6be9181.zip ffmpeg-streaming-8b58f6b5c286ba14ec9c6c9e03f9ede8c6be9181.tar.gz |
Revert "raw: move buffer size check up."
This reverts commit cc5dd632cecc5114717d0b90f8c2be162b1c6ee8.
The change was redundant, it has been fixed long ago (422e3a7)
Conflicts:
libavcodec/rawdec.c
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/rawdec.c')
-rw-r--r-- | libavcodec/rawdec.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c index b592243..f27df2a 100644 --- a/libavcodec/rawdec.c +++ b/libavcodec/rawdec.c @@ -155,9 +155,6 @@ static int raw_decode(AVCodecContext *avctx, frame->top_field_first = context->tff; } - if(buf_size < context->length - (avctx->pix_fmt==PIX_FMT_PAL8 ? 256*4 : 0)) - return -1; - if (avctx->width <= 0 || avctx->height <= 0) { av_log(avctx, AV_LOG_ERROR, "w/h is invalid\n"); return AVERROR(EINVAL); @@ -190,6 +187,9 @@ static int raw_decode(AVCodecContext *avctx, avctx->codec_tag == MKTAG('A', 'V', 'u', 'p')) buf += buf_size - context->length; + if(buf_size < context->length - (avctx->pix_fmt==PIX_FMT_PAL8 ? 256*4 : 0)) + return -1; + avpicture_fill(picture, buf, avctx->pix_fmt, avctx->width, avctx->height); if((avctx->pix_fmt==PIX_FMT_PAL8 && buf_size < context->length) || (av_pix_fmt_descriptors[avctx->pix_fmt].flags & PIX_FMT_PSEUDOPAL)) { |