aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Sabatini <stefasab@gmail.com>2012-06-25 18:56:46 +0200
committerStefano Sabatini <stefasab@gmail.com>2012-07-03 01:25:02 +0200
commitab7dbdc92c449d6c26cc164d149395bd753c0e53 (patch)
tree35c6fb6d792b30e95759ddd39b34ed0506f4f99f
parent17a54f5de8a8482d59a6af4b93505bd802704188 (diff)
downloadffmpeg-ab7dbdc92c449d6c26cc164d149395bd753c0e53.tar.gz
lavc/rawdec: add assertion check in raw_decode()
Check on an implicit assumption done on the number of coded bits for paletted rawvideo with coded bits == 2.
-rw-r--r--libavcodec/rawdec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c
index 7b7840f152..ba416db897 100644
--- a/libavcodec/rawdec.c
+++ b/libavcodec/rawdec.c
@@ -27,6 +27,7 @@
#include "avcodec.h"
#include "imgconvert.h"
#include "raw.h"
+#include "libavutil/avassert.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
@@ -179,6 +180,7 @@ static int raw_decode(AVCodecContext *avctx,
}
linesize_align = 8;
} else {
+ av_assert0(avctx->bits_per_coded_sample == 2);
for(i=0; 4*i+3 < buf_size && i<avpkt->size; i++){
dst[4*i+0]= buf[i]>>6;
dst[4*i+1]= buf[i]>>4&3;