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

« back to all changes in this revision

Viewing changes to libavcodec/idcinvideo.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:
49
49
#include <string.h>
50
50
 
51
51
#include "avcodec.h"
 
52
#include "internal.h"
 
53
#include "libavutil/internal.h"
52
54
 
53
55
#define HUFFMAN_TABLE_SIZE 64 * 1024
54
56
#define HUF_TOKENS 256
150
152
    unsigned char *histograms;
151
153
 
152
154
    s->avctx = avctx;
153
 
    avctx->pix_fmt = PIX_FMT_PAL8;
 
155
    avctx->pix_fmt = AV_PIX_FMT_PAL8;
154
156
 
155
157
    /* make sure the Huffman tables make it */
156
158
    if (s->avctx->extradata_size != HUFFMAN_TABLE_SIZE) {
208
210
}
209
211
 
210
212
static int idcin_decode_frame(AVCodecContext *avctx,
211
 
                              void *data, int *data_size,
 
213
                              void *data, int *got_frame,
212
214
                              AVPacket *avpkt)
213
215
{
214
216
    const uint8_t *buf = avpkt->data;
222
224
    if (s->frame.data[0])
223
225
        avctx->release_buffer(avctx, &s->frame);
224
226
 
225
 
    if (avctx->get_buffer(avctx, &s->frame)) {
 
227
    if (ff_get_buffer(avctx, &s->frame)) {
226
228
        av_log(avctx, AV_LOG_ERROR, "  id CIN Video: get_buffer() failed\n");
227
229
        return -1;
228
230
    }
236
238
    /* make the palette available on the way out */
237
239
    memcpy(s->frame.data[1], s->pal, AVPALETTE_SIZE);
238
240
 
239
 
    *data_size = sizeof(AVFrame);
 
241
    *got_frame = 1;
240
242
    *(AVFrame*)data = s->frame;
241
243
 
242
244
    /* report that the buffer was completely consumed */
256
258
AVCodec ff_idcin_decoder = {
257
259
    .name           = "idcinvideo",
258
260
    .type           = AVMEDIA_TYPE_VIDEO,
259
 
    .id             = CODEC_ID_IDCIN,
 
261
    .id             = AV_CODEC_ID_IDCIN,
260
262
    .priv_data_size = sizeof(IdcinContext),
261
263
    .init           = idcin_decode_init,
262
264
    .close          = idcin_decode_end,
263
265
    .decode         = idcin_decode_frame,
264
266
    .capabilities   = CODEC_CAP_DR1,
265
 
    .long_name = NULL_IF_CONFIG_SMALL("id Quake II CIN video"),
 
267
    .long_name      = NULL_IF_CONFIG_SMALL("id Quake II CIN video"),
266
268
};
267