X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=avi2swf%2Fvideoreader_vfw.cc;h=ca8a6b72f6af37cae017096f6e6e52a8a9180106;hp=91555e1862cc568d26e4ab7efd00cc4b9a723e4e;hb=2c719855eac434f01d47ba0717d76de65939d74e;hpb=1dc6bcc3e70277f87486e1bfe9500ea49b1be57e diff --git a/avi2swf/videoreader_vfw.cc b/avi2swf/videoreader_vfw.cc index 91555e1..ca8a6b7 100644 --- a/avi2swf/videoreader_vfw.cc +++ b/avi2swf/videoreader_vfw.cc @@ -73,8 +73,8 @@ static int bitmap_to_rgba(BITMAPINFOHEADER*bi, void*buffer, const int dest_width ULONG*dest = (ULONG*)buffer; - int width = bi->biWidth; - int height = bi->biHeight; + int width = abs(bi->biWidth); + int height = abs(bi->biHeight); if(dest_width != width || dest_height != height) { /* TODO: size conversion */ fprintf(stderr, "size mismatch: %dx%d != %dx%d\n", width, height, dest_width, dest_height); @@ -326,11 +326,11 @@ int videoreader_vfw_open(videoreader_t* vr, char* filename) if(1) { i->bitmap = bitmap; i->vs = stream; - i->width = bitmap.biWidth; - i->height = bitmap.biHeight; + i->width = abs(bitmap.biWidth); + i->height = abs(bitmap.biHeight); } else { fprintf(stderr, "Ignoring video stream: %dx%d compression=%d planes=%d\n", - bitmap.biWidth, bitmap.biHeight, + abs(bitmap.biWidth), abs(bitmap.biHeight), bitmap.biCompression,bitmap.biPlanes); } }