diff options
Diffstat (limited to 'libavcodec/sp5xdec.c')
-rw-r--r-- | libavcodec/sp5xdec.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/libavcodec/sp5xdec.c b/libavcodec/sp5xdec.c index 90c34911bd..b083015f00 100644 --- a/libavcodec/sp5xdec.c +++ b/libavcodec/sp5xdec.c @@ -2,20 +2,20 @@ * Sunplus JPEG decoder (SP5X) * Copyright (c) 2003 Alex Beregszaszi * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -72,7 +72,7 @@ static int sp5x_decode_frame(AVCodecContext *avctx, for (i = 2; i < buf_size-2 && j < buf_size+1024-2; i++) recoded[j++] = buf[i]; else - for (i = 14; i < buf_size && j < buf_size+1024-2; i++) + for (i = 14; i < buf_size && j < buf_size+1024-3; i++) { recoded[j++] = buf[i]; if (buf[i] == 0xff) @@ -90,9 +90,10 @@ static int sp5x_decode_frame(AVCodecContext *avctx, av_free(recoded); - return i; + return i < 0 ? i : avpkt->size; } +#if CONFIG_SP5X_DECODER AVCodec ff_sp5x_decoder = { .name = "sp5x", .type = AVMEDIA_TYPE_VIDEO, @@ -102,9 +103,11 @@ AVCodec ff_sp5x_decoder = { .close = ff_mjpeg_decode_end, .decode = sp5x_decode_frame, .capabilities = CODEC_CAP_DR1, + .max_lowres = 3, .long_name = NULL_IF_CONFIG_SMALL("Sunplus JPEG (SP5X)"), }; - +#endif +#if CONFIG_AMV_DECODER AVCodec ff_amv_decoder = { .name = "amv", .type = AVMEDIA_TYPE_VIDEO, @@ -115,3 +118,4 @@ AVCodec ff_amv_decoder = { .decode = sp5x_decode_frame, .long_name = NULL_IF_CONFIG_SMALL("AMV Video"), }; +#endif |