| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Pictor/PC Paint decoder | 2 * Pictor/PC Paint decoder |
| 3 * Copyright (c) 2010 Peter Ross <pross@xvid.org> | 3 * Copyright (c) 2010 Peter Ross <pross@xvid.org> |
| 4 * | 4 * |
| 5 * This file is part of FFmpeg. | 5 * This file is part of FFmpeg. |
| 6 * | 6 * |
| 7 * FFmpeg is free software; you can redistribute it and/or | 7 * FFmpeg is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Lesser General Public | 8 * modify it under the terms of the GNU Lesser General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2.1 of the License, or (at your option) any later version. | 10 * version 2.1 of the License, or (at your option) any later version. |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 if (buf_end - buf < esize) | 129 if (buf_end - buf < esize) |
| 130 return AVERROR_INVALIDDATA; | 130 return AVERROR_INVALIDDATA; |
| 131 } else { | 131 } else { |
| 132 etype = -1; | 132 etype = -1; |
| 133 esize = 0; | 133 esize = 0; |
| 134 } | 134 } |
| 135 | 135 |
| 136 avctx->pix_fmt = PIX_FMT_PAL8; | 136 avctx->pix_fmt = PIX_FMT_PAL8; |
| 137 | 137 |
| 138 if (s->width != avctx->width && s->height != avctx->height) { | 138 if (s->width != avctx->width && s->height != avctx->height) { |
| 139 if (av_check_image_size(s->width, s->height, 0, avctx) < 0) | 139 if (av_image_check_size(s->width, s->height, 0, avctx) < 0) |
| 140 return -1; | 140 return -1; |
| 141 avcodec_set_dimensions(avctx, s->width, s->height); | 141 avcodec_set_dimensions(avctx, s->width, s->height); |
| 142 if (s->frame.data[0]) | 142 if (s->frame.data[0]) |
| 143 avctx->release_buffer(avctx, &s->frame); | 143 avctx->release_buffer(avctx, &s->frame); |
| 144 } | 144 } |
| 145 | 145 |
| 146 if (avctx->get_buffer(avctx, &s->frame) < 0){ | 146 if (avctx->get_buffer(avctx, &s->frame) < 0){ |
| 147 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); | 147 av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); |
| 148 return -1; | 148 return -1; |
| 149 } | 149 } |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 CODEC_TYPE_VIDEO, | 242 CODEC_TYPE_VIDEO, |
| 243 CODEC_ID_PICTOR, | 243 CODEC_ID_PICTOR, |
| 244 sizeof(PicContext), | 244 sizeof(PicContext), |
| 245 NULL, | 245 NULL, |
| 246 NULL, | 246 NULL, |
| 247 decode_end, | 247 decode_end, |
| 248 decode_frame, | 248 decode_frame, |
| 249 CODEC_CAP_DR1, | 249 CODEC_CAP_DR1, |
| 250 .long_name = NULL_IF_CONFIG_SMALL("Pictor/PC Paint"), | 250 .long_name = NULL_IF_CONFIG_SMALL("Pictor/PC Paint"), |
| 251 }; | 251 }; |
| OLD | NEW |