~ubuntu-branches/ubuntu/trusty/libav/trusty-proposed

« back to all changes in this revision

Viewing changes to libavcodec/gifdec.c

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2013-10-22 23:24:08 UTC
  • mfrom: (1.3.36 sid)
  • Revision ID: package-import@ubuntu.com-20131022232408-b8tvvn4pyzri9mi3
Tags: 6:9.10-1ubuntu1
* Build all -extra flavors from this source package, as libav got demoted
  from main to universe, cf LP: #1243235
* Simplify debian/rules to follow exactly the code that debian executes
* New upstream (LP: #1180288) fixes lots of security issues (LP: #1242802)
* Merge from unstable, remaining changes:
  - build-depend on libtiff5-dev rather than libtiff4-dev,
    avoids FTBFS caused by imlib
  - follow the regular debian codepaths

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include "libavutil/imgutils.h"
26
26
#include "avcodec.h"
27
27
#include "bytestream.h"
 
28
#include "internal.h"
28
29
#include "lzw.h"
29
30
 
30
31
#define GCE_DISPOSAL_NONE       0
281
282
    return 0;
282
283
}
283
284
 
284
 
static int gif_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
 
285
static int gif_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
 
286
                            AVPacket *avpkt)
285
287
{
286
288
    const uint8_t *buf = avpkt->data;
287
289
    int buf_size = avpkt->size;
294
296
    if (gif_read_header1(s) < 0)
295
297
        return -1;
296
298
 
297
 
    avctx->pix_fmt = PIX_FMT_PAL8;
 
299
    avctx->pix_fmt = AV_PIX_FMT_PAL8;
298
300
    if (av_image_check_size(s->screen_width, s->screen_height, 0, avctx))
299
301
        return -1;
300
302
    avcodec_set_dimensions(avctx, s->screen_width, s->screen_height);
301
303
 
302
304
    if (s->picture.data[0])
303
305
        avctx->release_buffer(avctx, &s->picture);
304
 
    if (avctx->get_buffer(avctx, &s->picture) < 0) {
 
306
    if (ff_get_buffer(avctx, &s->picture) < 0) {
305
307
        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
306
308
        return -1;
307
309
    }
311
313
        return ret;
312
314
 
313
315
    *picture = s->picture;
314
 
    *data_size = sizeof(AVPicture);
 
316
    *got_frame = 1;
315
317
    return s->bytestream - buf;
316
318
}
317
319
 
328
330
AVCodec ff_gif_decoder = {
329
331
    .name           = "gif",
330
332
    .type           = AVMEDIA_TYPE_VIDEO,
331
 
    .id             = CODEC_ID_GIF,
 
333
    .id             = AV_CODEC_ID_GIF,
332
334
    .priv_data_size = sizeof(GifState),
333
335
    .init           = gif_decode_init,
334
336
    .close          = gif_decode_close,
335
337
    .decode         = gif_decode_frame,
336
338
    .capabilities   = CODEC_CAP_DR1,
337
 
    .long_name = NULL_IF_CONFIG_SMALL("GIF (Graphics Interchange Format)"),
 
339
    .long_name      = NULL_IF_CONFIG_SMALL("GIF (Graphics Interchange Format)"),
338
340
};