git.videolan.org
/
ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e6da5d2
)
rawdec: use AVPALETTE_SIZE instead of magic constants.
author
Anton Khirnov
<anton@khirnov.net>
Thu, 3 Jan 2013 16:19:01 +0000
(17:19 +0100)
committer
Anton Khirnov
<anton@khirnov.net>
Tue, 29 Jan 2013 06:31:43 +0000
(07:31 +0100)
libavcodec/rawdec.c
patch
|
blob
|
history
diff --git
a/libavcodec/rawdec.c
b/libavcodec/rawdec.c
index
2751f34
..
ab93d49
100644
(file)
--- a/
libavcodec/rawdec.c
+++ b/
libavcodec/rawdec.c
@@
-138,14
+138,15
@@
static int raw_decode(AVCodecContext *avctx, void *data, int *got_frame,
frame->reordered_opaque = avctx->reordered_opaque;
frame->pkt_pts = avctx->pkt->pts;
frame->reordered_opaque = avctx->reordered_opaque;
frame->pkt_pts = avctx->pkt->pts;
- if (buf_size < context->length - (avctx->pix_fmt == AV_PIX_FMT_PAL8 ? 256 * 4 : 0))
+ if (buf_size < context->length - (avctx->pix_fmt == AV_PIX_FMT_PAL8 ?
+ AVPALETTE_SIZE : 0))
return -1;
//2bpp and 4bpp raw in avi and mov (yes this is ugly ...)
if (context->buffer) {
int i;
uint8_t *dst = context->buffer;
return -1;
//2bpp and 4bpp raw in avi and mov (yes this is ugly ...)
if (context->buffer) {
int i;
uint8_t *dst = context->buffer;
- buf_size = context->length -
256 * 4
;
+ buf_size = context->length -
AVPALETTE_SIZE
;
if (avctx->bits_per_coded_sample == 4) {
for (i = 0; 2 * i + 1 < buf_size; i++) {
dst[2 * i + 0] = buf[i] >> 4;
if (avctx->bits_per_coded_sample == 4) {
for (i = 0; 2 * i + 1 < buf_size; i++) {
dst[2 * i + 0] = buf[i] >> 4;