diff options
author | Stefano Sabatini <stefasab@gmail.com> | 2012-06-25 17:59:01 +0200 |
---|---|---|
committer | Stefano Sabatini <stefasab@gmail.com> | 2012-07-03 01:24:56 +0200 |
commit | 17a54f5de8a8482d59a6af4b93505bd802704188 (patch) | |
tree | 3adb4283bee164bef270a7a6b10fb536677004b1 /libavcodec/rawdec.c | |
parent | 4330b8bba24aab456bd302c50d71aacad196d48c (diff) | |
download | ffmpeg-17a54f5de8a8482d59a6af4b93505bd802704188.tar.gz |
lavc/rawdec: prefer constant AVPALETTE_SIZE over 256*4
Improve readability.
Diffstat (limited to 'libavcodec/rawdec.c')
-rw-r--r-- | libavcodec/rawdec.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c index 25ecde19a2..7b7840f152 100644 --- a/libavcodec/rawdec.c +++ b/libavcodec/rawdec.c @@ -171,7 +171,7 @@ static int raw_decode(AVCodecContext *avctx, 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<avpkt->size; i++){ dst[2*i+0]= buf[i]>>4; @@ -194,7 +194,7 @@ static int raw_decode(AVCodecContext *avctx, avctx->codec_tag == MKTAG('A', 'V', 'u', 'p')) buf += buf_size - context->length; - len = context->length - (avctx->pix_fmt==PIX_FMT_PAL8 ? 256*4 : 0); + len = context->length - (avctx->pix_fmt==PIX_FMT_PAL8 ? AVPALETTE_SIZE : 0); if (buf_size < len) { av_log(avctx, AV_LOG_ERROR, "Invalid buffer size, packet size %d < expected length %d\n", buf_size, len); return AVERROR(EINVAL); |