changeset 10341:e9435ad2d61e libavcodec

Add support for TARGA images without RLE compression. Patch by Anne-Laure de Smit: gmail_address(annelaure, desmit)
author benoit
date Thu, 01 Oct 2009 12:20:08 +0000
parents 5f263438d11b
children fc22144efcaf
files targaenc.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/targaenc.c	Thu Oct 01 09:30:08 2009 +0000
+++ b/targaenc.c	Thu Oct 01 12:20:08 2009 +0000
@@ -76,7 +76,7 @@
                               unsigned char *outbuf,
                               int buf_size, void *data){
     AVFrame *p = data;
-    int bpp, picsize, datasize;
+    int bpp, picsize, datasize = -1;
     uint8_t *out;
 
     if(avctx->width > 0xffff || avctx->height > 0xffff) {
@@ -120,6 +120,7 @@
     out = outbuf + 18;  /* skip past the header we just output */
 
     /* try RLE compression */
+    if (avctx->coder_type != FF_CODER_TYPE_RAW)
     datasize = targa_encode_rle(out, picsize, p, bpp, avctx->width, avctx->height);
 
     /* if that worked well, mark the picture as RLE compressed */