summaryrefslogtreecommitdiff
path: root/libavcodec/pnm.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-08-03 14:01:03 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-08-03 14:01:03 +0200
commitb4d525eb634666e39745585b17c35faed54352b6 (patch)
tree17b0054664ad0539bccbcdeb9fc3bb2c476fab6b /libavcodec/pnm.c
parent4fed0198216d325875047e564caa42aff4481ec4 (diff)
downloadffmpeg-b4d525eb634666e39745585b17c35faed54352b6.tar.gz
avcodec/pnm: check buf[0] before using buf[1]
Fixes CSA warning Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/pnm.c')
-rw-r--r--libavcodec/pnm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/pnm.c b/libavcodec/pnm.c
index 63b77cd807..502e550097 100644
--- a/libavcodec/pnm.c
+++ b/libavcodec/pnm.c
@@ -63,9 +63,9 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s)
int h, w, depth, maxval;
pnm_get(s, buf1, sizeof(buf1));
- s->type= buf1[1]-'0';
if(buf1[0] != 'P')
return AVERROR_INVALIDDATA;
+ s->type= buf1[1]-'0';
if (s->type==1 || s->type==4) {
avctx->pix_fmt = AV_PIX_FMT_MONOWHITE;