~ubuntu-branches/ubuntu/quantal/libav/quantal-updates

« back to all changes in this revision

Viewing changes to libavcodec/lcldec.c

  • Committer: Package Import Robot
  • Author(s): Micah Gersten
  • Date: 2012-03-21 21:18:24 UTC
  • mfrom: (1.2.10)
  • Revision ID: package-import@ubuntu.com-20120321211824-n63p3v3s99q3mxrb
Tags: 4:0.8.1-0ubuntu1
* New upstream bug and security fix release (FFe: LP: #960949)
  - fixes the following CVEs:
    CVE-2012-0848, CVE-2012-0853, CVE-2012-0858, CVE-2011-3929,
    CVE-2011-3936, CVE-2011-3937, CVE-2011-3940, CVE-2011-3945,
    CVE-2011-3947, CVE-2011-3951, CVE-2011-3952

* Pull fix from Debian git to fix installation of avserver.conf and
  recordshow.sh into libav-tools; Thanks to Julien Cristau for spotting this!
  - update debian/rules

Show diffs side-by-side

added added

removed removed

Lines of Context:
223
223
                len = mszh_dlen;
224
224
            }
225
225
            break;
226
 
        case COMP_MSZH_NOCOMP:
 
226
        case COMP_MSZH_NOCOMP: {
 
227
            int bppx2;
 
228
            switch (c->imgtype) {
 
229
            case IMGTYPE_YUV111:
 
230
            case IMGTYPE_RGB24:
 
231
                bppx2 = 6;
 
232
                break;
 
233
            case IMGTYPE_YUV422:
 
234
            case IMGTYPE_YUV211:
 
235
                bppx2 = 4;
 
236
                break;
 
237
            case IMGTYPE_YUV411:
 
238
            case IMGTYPE_YUV420:
 
239
                bppx2 = 3;
 
240
                break;
 
241
            default:
 
242
                bppx2 = 0; // will error out below
 
243
                break;
 
244
            }
 
245
            if (len < ((width * height * bppx2) >> 1))
 
246
                return AVERROR_INVALIDDATA;
227
247
            break;
 
248
        }
228
249
        default:
229
250
            av_log(avctx, AV_LOG_ERROR, "BUG! Unknown MSZH compression in frame decoder.\n");
230
251
            return -1;
455
476
 
456
477
    if (avctx->extradata_size < 8) {
457
478
        av_log(avctx, AV_LOG_ERROR, "Extradata size too small.\n");
458
 
        return 1;
 
479
        return AVERROR_INVALIDDATA;
459
480
    }
460
481
 
461
482
    /* Check codec type */
504
525
        break;
505
526
    default:
506
527
        av_log(avctx, AV_LOG_ERROR, "Unsupported image format %d.\n", c->imgtype);
507
 
        return 1;
 
528
        return AVERROR_INVALIDDATA;
508
529
    }
509
530
 
510
531
    /* Detect compression method */
521
542
            break;
522
543
        default:
523
544
            av_log(avctx, AV_LOG_ERROR, "Unsupported compression format for MSZH (%d).\n", c->compression);
524
 
            return 1;
 
545
            return AVERROR_INVALIDDATA;
525
546
        }
526
547
        break;
527
548
#if CONFIG_ZLIB_DECODER
539
560
        default:
540
561
            if (c->compression < Z_NO_COMPRESSION || c->compression > Z_BEST_COMPRESSION) {
541
562
                av_log(avctx, AV_LOG_ERROR, "Unsupported compression level for ZLIB: (%d).\n", c->compression);
542
 
                return 1;
 
563
                return AVERROR_INVALIDDATA;
543
564
            }
544
565
            av_log(avctx, AV_LOG_DEBUG, "Compression level for ZLIB: (%d).\n", c->compression);
545
566
        }
547
568
#endif
548
569
    default:
549
570
        av_log(avctx, AV_LOG_ERROR, "BUG! Unknown codec in compression switch.\n");
550
 
        return 1;
 
571
        return AVERROR_INVALIDDATA;
551
572
    }
552
573
 
553
574
    /* Allocate decompression buffer */
554
575
    if (c->decomp_size) {
555
576
        if ((c->decomp_buf = av_malloc(max_decomp_size)) == NULL) {
556
577
            av_log(avctx, AV_LOG_ERROR, "Can't allocate decompression buffer.\n");
557
 
            return 1;
 
578
            return AVERROR(ENOMEM);
558
579
        }
559
580
    }
560
581
 
580
601
        if (zret != Z_OK) {
581
602
            av_log(avctx, AV_LOG_ERROR, "Inflate init error: %d\n", zret);
582
603
            av_freep(&c->decomp_buf);
583
 
            return 1;
 
604
            return AVERROR_UNKNOWN;
584
605
        }
585
606
    }
586
607
#endif