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

« back to all changes in this revision

Viewing changes to libavcodec/rpza.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:
38
38
#include <stdlib.h>
39
39
#include <string.h>
40
40
 
 
41
#include "libavutil/internal.h"
41
42
#include "libavutil/intreadwrite.h"
42
43
#include "avcodec.h"
43
44
 
202
203
 
203
204
        /* Fill block with 16 colors */
204
205
        case 0x00:
205
 
            if (s->size - stream_ptr < 16)
 
206
            if (s->size - stream_ptr < 30)
206
207
                return;
207
208
            block_ptr = row_ptr + pixel_ptr;
208
209
            for (pixel_y = 0; pixel_y < 4; pixel_y++) {
235
236
    RpzaContext *s = avctx->priv_data;
236
237
 
237
238
    s->avctx = avctx;
238
 
    avctx->pix_fmt = PIX_FMT_RGB555;
 
239
    avctx->pix_fmt = AV_PIX_FMT_RGB555;
239
240
 
240
241
    s->frame.data[0] = NULL;
241
242
 
243
244
}
244
245
 
245
246
static int rpza_decode_frame(AVCodecContext *avctx,
246
 
                             void *data, int *data_size,
 
247
                             void *data, int *got_frame,
247
248
                             AVPacket *avpkt)
248
249
{
249
250
    const uint8_t *buf = avpkt->data;
262
263
 
263
264
    rpza_decode_stream(s);
264
265
 
265
 
    *data_size = sizeof(AVFrame);
 
266
    *got_frame      = 1;
266
267
    *(AVFrame*)data = s->frame;
267
268
 
268
269
    /* always report that the buffer was completely consumed */
282
283
AVCodec ff_rpza_decoder = {
283
284
    .name           = "rpza",
284
285
    .type           = AVMEDIA_TYPE_VIDEO,
285
 
    .id             = CODEC_ID_RPZA,
 
286
    .id             = AV_CODEC_ID_RPZA,
286
287
    .priv_data_size = sizeof(RpzaContext),
287
288
    .init           = rpza_decode_init,
288
289
    .close          = rpza_decode_end,
289
290
    .decode         = rpza_decode_frame,
290
291
    .capabilities   = CODEC_CAP_DR1,
291
 
    .long_name = NULL_IF_CONFIG_SMALL("QuickTime video (RPZA)"),
 
292
    .long_name      = NULL_IF_CONFIG_SMALL("QuickTime video (RPZA)"),
292
293
};