lavd/dshow: Interpret negative height as bottom-down frame.
authorCarl Eugen Hoyos <ceffmpeg@gmail.com>
Mon, 17 Sep 2018 22:16:42 +0000 (00:16 +0200)
committerCarl Eugen Hoyos <ceffmpeg@gmail.com>
Wed, 19 Sep 2018 16:13:46 +0000 (18:13 +0200)
Fixes ticket #7436.

libavdevice/dshow.c

index de910c0..757f7a5 100644 (file)
@@ -996,11 +996,15 @@ dshow_add_device(AVFormatContext *avctx,
             par->codec_id = AV_CODEC_ID_RAWVIDEO;
             if (bih->biCompression == BI_RGB || bih->biCompression == BI_BITFIELDS) {
                 par->bits_per_coded_sample = bih->biBitCount;
+                if (par->height < 0) {
+                    par->height *= -1;
+                } else {
                 par->extradata = av_malloc(9 + AV_INPUT_BUFFER_PADDING_SIZE);
                 if (par->extradata) {
                     par->extradata_size = 9;
                     memcpy(par->extradata, "BottomUp", 9);
                 }
+                }
             }
         }
     } else {