aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGyan Doshi <ffmpeg@gyani.pro>2020-07-25 10:39:32 +0530
committerGyan Doshi <ffmpeg@gyani.pro>2020-07-26 11:09:39 +0530
commit93694fe777d12a9432b5ceeb564631da6311ae26 (patch)
tree5eca7eab8e211913b32d43898e6e42eaaab95056
parent7c8ad72f1ce2ae747edd5c3f49bb052b1586c90f (diff)
downloadffmpeg-93694fe777d12a9432b5ceeb564631da6311ae26.tar.gz
avformat/riffenc: correct calculation for extradata size
In 1ec2b3de5a, the extradata size was affected when the raster was signaled as flipped due to user-set option rather than via extradata. This resulted in a wrong header size being written. Fixed.
-rw-r--r--libavformat/riffenc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavformat/riffenc.c b/libavformat/riffenc.c
index d0ee98bfcc..04a21fcffa 100644
--- a/libavformat/riffenc.c
+++ b/libavformat/riffenc.c
@@ -209,10 +209,10 @@ int ff_put_wav_header(AVFormatContext *s, AVIOContext *pb,
void ff_put_bmp_header(AVIOContext *pb, AVCodecParameters *par,
int for_asf, int ignore_extradata, int rgb_frame_is_flipped)
{
- int keep_height = (par->extradata_size >= 9 &&
- !memcmp(par->extradata + par->extradata_size - 9, "BottomUp", 9)) ||
- rgb_frame_is_flipped;
- int extradata_size = par->extradata_size - 9*keep_height;
+ int flipped_extradata = (par->extradata_size >= 9 &&
+ !memcmp(par->extradata + par->extradata_size - 9, "BottomUp", 9));
+ int keep_height = flipped_extradata || rgb_frame_is_flipped;
+ int extradata_size = par->extradata_size - 9*flipped_extradata;
enum AVPixelFormat pix_fmt = par->format;
int pal_avi;